Beispiel #1
0
 def test_authenticate_inactive(self):
     self.user.is_active = False
     self.user.save()
     request = HttpRequest()
     self.assertFalse(
         authenticate(request,
                      self.get_auth_string(self.user.auth_token.key)))
Beispiel #2
0
 def test_authenticate_inactive(self):
     self.user.is_active = False
     self.user.save()
     request = HttpRequest()
     self.assertFalse(authenticate(
         request,
         self.get_auth_string(self.user.auth_token.key)
     ))
Beispiel #3
0
 def test_authenticate_basic(self):
     request = HttpRequest()
     self.assertTrue(
         authenticate(request,
                      self.get_auth_string(self.user.auth_token.key)))
Beispiel #4
0
 def test_authenticate_wrong(self):
     request = HttpRequest()
     self.assertFalse(authenticate(request,
                                   self.get_auth_string("invalid")))
Beispiel #5
0
 def test_authenticate_digest(self):
     request = HttpRequest()
     self.assertFalse(authenticate(request, "digest fdsafds"))
Beispiel #6
0
 def test_authenticate_basic_invalid(self):
     request = HttpRequest()
     self.assertFalse(authenticate(request, "basic fdsafds"))
Beispiel #7
0
 def test_authenticate_missing(self):
     request = HttpRequest()
     self.assertFalse(authenticate(request, "basic "))
Beispiel #8
0
 def test_authenticate_invalid(self):
     request = HttpRequest()
     self.assertFalse(authenticate(request, "foo"))
Beispiel #9
0
 def test_authenticate_basic(self):
     request = HttpRequest()
     self.assertTrue(authenticate(request, self.get_auth_string(self.user.auth_token.key)))
Beispiel #10
0
 def test_authenticate_basic_wrong(self):
     request = HttpRequest()
     self.assertFalse(authenticate(request, self.get_auth_string("invalid")))
Beispiel #11
0
 def test_authenticate_digest(self):
     request = HttpRequest()
     self.assertFalse(authenticate(request, "digest fdsafds"))
Beispiel #12
0
 def test_authenticate_basic_invalid(self):
     request = HttpRequest()
     self.assertFalse(authenticate(request, "basic fdsafds"))
Beispiel #13
0
 def test_authenticate_missing(self):
     request = HttpRequest()
     self.assertFalse(authenticate(request, "basic "))
Beispiel #14
0
 def test_authenticate_invalid(self):
     request = HttpRequest()
     self.assertFalse(authenticate(request, "foo"))