コード例 #1
0
 def test_authenticate_nonexistent_user_returns_none(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertIsNone(FacilityBackend().authenticate("foo", "bar"))
コード例 #2
0
 def test_nonexistent_user_returns_none(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertIsNone(FacilityBackend().get_user(4756))
コード例 #3
0
 def test_get_device_owner(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertIsNone(FacilityBackend().get_user(self.do.id))
コード例 #4
0
 def test_get_facility_user(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertEqual(self.user, FacilityBackend().get_user(self.user.id))
コード例 #5
0
 def test_device_owner_not_authenticated(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertIsNone(FacilityBackend().authenticate(username="******", password="******"))
コード例 #6
0
 def test_facility_user_authenticated(self):
     from kolibri.auth.backends import FacilityBackend
     self.assertEqual(self.user, FacilityBackend().authenticate(username="******", password="******"))