<commit_before># -*- encoding:utf-8 -*-
from django.test import TestCase, client

from .models import User

client = client.Client()


class TestUserSearch(TestCase):
    def setUp(self):
        kril = User.objects.create(
            username='Kril',
            first_name='Kril',
            faculty_number='61277',
            email='<EMAIL>',)
        kril.set_password('<PASSWORD>')
        kril.save()

        ivo = User.objects.create(
            username='ivo',
            first_name='Ivailo',
            faculty_number='61279',
            email='<EMAIL>',)
        ivo.set_password('root')
        ivo.save()

        self.gogo = User.objects.create(
            username='gogo',
            first_name='Георги',
            faculty_number='63279',
            email='<EMAIL>',)
        self.gogo.set_password('<PASSWORD>')
        self.gogo.save()

    def test_search_users_in_en(self):
        response = client.get('/search/i/')
        self.assertEqual(response.status_code, 200)
        self.assertTrue(response.content)

    def test_search_users_in_bg(self):
        response = client.get('/search/{}/'.format(self.gogo.first_name))
        self.assertEqual(response.status_code, 200)
        self.assertTrue(response.content)

    def test_user_not_found(self):
        response = client.get('/search/pe/')
        self.assertEqual(response.status_code, 200)
        self.assertFalse(response.content)


<commit_msg>Fix tests for searching users<commit_after># -*- encoding:utf-8 -*-
from django.test import TestCase, client

from .models import User

client = client.Client()


class TestUserSearch(TestCase):
    def setUp(self):
        kril = User.objects.create(
            username='Kril',
            first_name='Kril',
            faculty_number='61277',
            email='<EMAIL>',)
        kril.set_password('<PASSWORD>')
        kril.save()

        ivo = User.objects.create(
            username='ivo',
            first_name='Ivailo',
            faculty_number='61279',
            email='<EMAIL>',)
        ivo.set_password('<PASSWORD>')
        ivo.save()

        self.gogo = User.objects.create(
            username='gogo',
            first_name='Георги',
            faculty_number='63279',
            email='<EMAIL>',)
        self.gogo.set_password('<PASSWORD>')
        self.gogo.save()

    def test_search_users_in_en(self):
        response = client.get('/search/i/')
        self.assertEqual(response.status_code, 200)
        self.assertTrue(response.content)

    def test_search_users_in_bg(self):
        response = client.get('/search/{}/'.format(self.gogo.first_name))
        self.assertEqual(response.status_code, 200)
        self.assertTrue(response.content)

    def test_user_not_found(self):
        response = client.get('/search/pe/')
        self.assertEqual(response.status_code, 200)
        self.assertEqual(response.content, '[]')



{'fraction_non_alphanumeric': 0.13642611683848796, 'fraction_numerical': 0.01718213058419244, 'mean_word_length': 2.3154897494305238, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '1151783', 'n_tokens_mistral': 907, 'n_tokens_neox': 875, 'n_words': 128}