<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    openslides.participant.tests
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Unit test for the participant app.

    :copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
    :license: GNU GPL, see LICENSE for more details.
"""

from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.hashers import check_password

from openslides.utils.person import get_person, Persons
from openslides.participant.api import gen_username, gen_password
from openslides.participant.models import User, Group


class UserTest(TestCase):
    def setUp(self):
        self.user1 = User()
        self.user1.first_name = u'Max'
        self.user1.last_name = u'Mustermann'
        self.user1.username = gen_username(
            self.user1.first_name, self.user1.last_name)
        self.user1.default_password = gen_password()
        self.user1.save()
        self.django_user1 = self.user1.django_user

    def test_participant_user(self):
        self.assertEqual(self.django_user1.user, self.user1)
        self.assertEqual(self.django_user1, self.user1.django_user)

    def test_repr(self):
        self.assertEqual(unicode(self.user1), '<NAME>')

    def test_name_surfix(self):
        self.user1.detail = 'München'
        self.user1.save()
        self.assertEqual(unicode(self.user1), '<NAME> (München)')

    def test_reset_password(self):<commit_msg>rename test_name_surfix in test_name_suffix in participant/tests.py<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    openslides.participant.tests
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Unit test for the participant app.

    :copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
    :license: GNU GPL, see LICENSE for more details.
"""

from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.hashers import check_password

from openslides.utils.person import get_person, Persons
from openslides.participant.api import gen_username, gen_password
from openslides.participant.models import User, Group


class UserTest(TestCase):
    def setUp(self):
        self.user1 = User()
        self.user1.first_name = u'Max'
        self.user1.last_name = u'Mustermann'
        self.user1.username = gen_username(
            self.user1.first_name, self.user1.last_name)
        self.user1.default_password = gen_password()
        self.user1.save()
        self.django_user1 = self.user1.django_user

    def test_participant_user(self):
        self.assertEqual(self.django_user1.user, self.user1)
        self.assertEqual(self.django_user1, self.user1.django_user)

    def test_repr(self):
        self.assertEqual(unicode(self.user1), '<NAME>')

    def test_name_suffix(self):
        self.user1.detail = 'München'
        self.user1.save()
        self.assertEqual(unicode(self.user1), '<NAME> (München)')

    def test_reset_password(self):
{'fraction_non_alphanumeric': 0.1230455472467709, 'fraction_numerical': 0.018354860639021073, 'mean_word_length': 3.405688622754491, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4800197', 'n_tokens_mistral': 960, 'n_tokens_neox': 908, 'n_words': 190}