<commit_before>from django.contrib.auth.models import User

from nose.tools import eq_

from sumo.tests import TestCase
from users.models import RegistrationProfile
from users.tests import profile


class ProfileTests(TestCase):
    fixtures = ['users.json']

    def test_user_get_profile(self):
        """user.get_profile() returns what you'd expect."""
        user = User.objects.all()[0]
        p = profile(user)

        eq_(p, user.get_profile())


class RegistrationProfileTests(TestCase):
    def test_create_inactive_user_locale(self):<commit_msg>Oops. Site.objects.get_current() should be patched in just-added profile test.<commit_after>from django.contrib.auth.models import User
from django.contrib.sites.models import Site

import mock
from nose.tools import eq_

from sumo.tests import TestCase
from users.models import RegistrationProfile
from users.tests import profile


class ProfileTests(TestCase):
    fixtures = ['users.json']

    def test_user_get_profile(self):
        """user.get_profile() returns what you'd expect."""
        user = User.objects.all()[0]
        p = profile(user)

        eq_(p, user.get_profile())


class RegistrationProfileTests(TestCase):
    @mock.patch.object(Site.objects, 'get_current')
    def test_create_inactive_user_locale(self, get_current):
        get_current.return_value.domain = 'testserver'

{'fraction_non_alphanumeric': 0.09919177075679647, 'fraction_numerical': 0.0014695077149155032, 'mean_word_length': 4.178707224334601, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4915004', 'n_tokens_mistral': 399, 'n_tokens_neox': 383, 'n_words': 100}