コード例 #1
0
 def testBadPassword(self):
     user = User(identity_id=uuid.uuid4(), primary=True)
     user.set_password('password')
     user.save()
     form = AuthenticationForm(data={
         'username': str(user.id),
         'password': '******'
     })
     self.assertFalse(form.is_valid())
コード例 #2
0
 def testUUID(self):
     user = User(identity_id=uuid.uuid4(), primary=True)
     user.set_password('password')
     user.save()
     form = AuthenticationForm(data={
         'username': str(user.id),
         'password': '******'
     })
     self.assertTrue(form.is_valid())
     self.assertEqual(str(user.id), form.cleaned_data['username'])
コード例 #3
0
 def testEmail(self):
     user = User(identity_id=uuid.uuid4(), primary=True)
     UserEmail.objects.create(user=user, email='*****@*****.**')
     user.set_password('password')
     user.save()
     form = AuthenticationForm(data={
         'username': '******',
         'password': '******'
     })
     self.assertTrue(form.is_valid())
     self.assertEqual(str(user.id), form.cleaned_data['username'])
コード例 #4
0
 def testEmpty(self):
     form = AuthenticationForm(data={
         'username': '',
         'password': '******'
     })
     self.assertFalse(form.is_valid())
コード例 #5
0
 def testBadEmail(self):
     form = AuthenticationForm(data={
         'username': '******',
         'password': '******'
     })
     self.assertFalse(form.is_valid())