示例#1
0
 def test_authenticate_with_wrong_password_returns_none(self):
     self.assertIsNone(FacilityBackend().authenticate("Mike", "goo"))
示例#2
0
 def test_nonexistent_user_returns_none(self):
     self.assertIsNone(FacilityBackend().get_user(4756))
示例#3
0
 def test_authenticate_nonexistent_user_returns_none(self):
     self.assertIsNone(FacilityBackend().authenticate("foo", "bar"))
示例#4
0
 def test_get_facility_user(self):
     self.assertEqual(self.user, FacilityBackend().get_user(self.user.id))
示例#5
0
 def test_get_device_owner(self):
     self.assertIsNone(FacilityBackend().get_user(self.do.id))
示例#6
0
 def test_facility_user_authenticated(self):
     self.assertEqual(
         self.user,
         FacilityBackend().authenticate(username="******", password="******"))
示例#7
0
 def test_device_owner_not_authenticated(self):
     self.assertIsNone(FacilityBackend().authenticate(username="******",
                                                      password="******"))
示例#8
0
 def test_authenticate_nonexistent_user_returns_none(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertIsNone(FacilityBackend().authenticate("foo", "bar"))
示例#9
0
 def test_authenticate_with_wrong_password_returns_none(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertIsNone(FacilityBackend().authenticate("Mike", "goo"))
示例#10
0
 def test_nonexistent_user_returns_none(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertIsNone(FacilityBackend().get_user(4756))
示例#11
0
 def test_get_device_owner(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertIsNone(FacilityBackend().get_user(self.do.id))
示例#12
0
 def test_get_facility_user(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertEqual(self.user, FacilityBackend().get_user(self.user.id))
示例#13
0
 def test_device_owner_not_authenticated(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertIsNone(FacilityBackend().authenticate(username="******", password="******"))
示例#14
0
 def test_facility_user_authenticated(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertEqual(self.user, FacilityBackend().authenticate(username="******", password="******"))