Beispiel #1
0
 def setUpTestData(cls):
     context = correct_user.copy()
     create_user_with_settings(context)
     context['login'] = '******'
     context['email'] = '*****@*****.**'
     context['is_researcher'] = ''
     create_user_with_settings(context)
 def setUpTestData(cls):
     context = correct_user.copy()
     create_user_with_settings(context)
     context['login'] = '******'
     context['email'] = '*****@*****.**'
     context['question'] = 'Enter three'
     create_user_with_settings(context)
Beispiel #3
0
 def setUp(self):
     context = correct_user.copy()
     context['login'] = '******'
     context['email'] = '*****@*****.**'
     context['is_researcher'] = ''
     create_user_with_settings(context)
     user = User.objects.get(username='******')
     self.client.force_login(user=user)
    def test_registration_function(self):
        context = correct_user.copy()

        create_user_with_settings(context)

        self.assertEqual(len(User.objects.filter(username='******')), 1)

        user = User.objects.get(username='******')

        self.assertEqual(user.username, 'test-login1')
        self.assertEqual(user.first_name, 'oleg')
        self.assertEqual(user.last_name, 'tester')
        self.assertEqual(user.email, '*****@*****.**')
        self.assertTrue(user.check_password('OlEgCOdEr'))

        algo_settings = AlgorithmSettings.objects.get(user=user)

        self.assertEqual(algo_settings.question, correct_user['question'])
        self.assertEqual(algo_settings.answer, correct_user['answer'])