示例#1
0
 def test_unique_username_created(self, username_mock):
     User(username='******').save()
     users.create_lti_user('lti_user_id', self.lti_consumer)
     self.assertEqual(username_mock.call_count, 2)
     self.assertEqual(User.objects.count(), 2)
     user = User.objects.get(username='******')
     self.assertEqual(user.email, '*****@*****.**')
示例#2
0
 def test_create_lti_user_creates_correct_user(self, uuid_mock,
                                               _username_mock):
     users.create_lti_user('lti_user_id', self.lti_consumer)
     self.assertEqual(User.objects.count(), 1)
     user = User.objects.get(username='******')
     self.assertEqual(user.email, '*****@*****.**')
     uuid_mock.assert_called_with()
示例#3
0
 def test_create_lti_user_creates_correct_user(self, uuid_mock, _username_mock):
     users.create_lti_user('lti_user_id', self.lti_consumer)
     self.assertEqual(User.objects.count(), 1)
     user = User.objects.get(username='******')
     self.assertEqual(user.email, '*****@*****.**')
     uuid_mock.assert_called_with()
示例#4
0
 def test_create_lti_user_creates_auth_user_model(self):
     users.create_lti_user('lti_user_id', self.lti_consumer)
     self.assertEqual(User.objects.count(), 1)