<commit_before>from django.test import TestCase, Client
from django.contrib.auth.models import User

from users.models import Profile, Link
from projects.models import Project


class ProfileData(TestCase):

    def setUp(self):
        self.client = Client()
        self.User = User.objects.create(
            username=u'testaccount',
            password=u'<PASSWORD>',
            is_active=True
        )
        self.Profile = Profile.objects.create(
            user=self.User
        )

    def test_social_links(self):
        user_slug = '/en-US/profile/%s/' % self.Profile.user.username
        response = self.client.get(user_slug)
        self.assertEqual(response.context['social_links'], False)

        Link.objects.create(
            name=u'Test',
            url=u'http://www.mozilla.org',
            profile=self.Profile
        )

        response = self.client.get(user_slug)
        self.assertNotEqual(response.context['social_links'], False)

    def test_project_links(self):
        user_slug = '/en-US/profile/%s/' % self.Profile.user.username
        response = self.client.get(user_slug)
        self.assertEqual(response.context['projects'], False)

        p = Project.objects.create(
            name=u'Shipment of Fail',
            slug=u'shipment-of-fail',
            description=u'Blah',
            long_description=u'Blah blah'
        )

        p.followers.add(self.Profile)<commit_msg>Instance variables should start with lowercase letters<commit_after>from django.test import TestCase, Client
from django.contrib.auth.models import User

from users.models import Profile, Link
from projects.models import Project


class ProfileData(TestCase):

    def setUp(self):
        self.client = Client()
        self.User = User.objects.create(
            username=u'testaccount',
            password=u'<PASSWORD>',
            is_active=True
        )
        self.profile = Profile.objects.create(
            user=self.User
        )

    def test_social_links(self):
        user_slug = '/en-US/profile/%s/' % self.profile.user.username
        response = self.client.get(user_slug)
        self.assertEqual(response.context['social_links'], False)

        Link.objects.create(
            name=u'Test',
            url=u'http://www.mozilla.org',
            profile=self.profile
        )

        response = self.client.get(user_slug)
        self.assertNotEqual(response.context['social_links'], False)

    def test_project_links(self):
        user_slug = '/en-US/profile/%s/' % self.profile.user.username
        response = self.client.get(user_slug)
        self.assertEqual(response.context['projects'], False)

        p = Project.objects.create(
            name=u'Shipment of Fail',
            slug=u'shipment-of-fail',
            description=u'Blah',
            long_description=u'Blah blah'
        )

        p.followers.add(self.profile)
{'fraction_non_alphanumeric': 0.11444329541537401, 'fraction_numerical': 0.0, 'mean_word_length': 2.3014789533560864, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5374669', 'n_tokens_mistral': 832, 'n_tokens_neox': 826, 'n_words': 141}