Exemple #1
0
 def test_unsubscribe_twice(self):
     self.create_prefs()
     request = self.request_factory.get("dummy")
     request.user = AnonymousUser()
     unsubscribe(request, self.tokens[self.user])
     response = unsubscribe(request, self.tokens[self.user])
     self.assertEqual(response.status_code, 200)
     self.assertNotPrefExists(self.user)
Exemple #2
0
 def test_unsubscribe_twice(self):
     self.create_prefs()
     request = self.request_factory.get("dummy")
     request.user = AnonymousUser()
     unsubscribe(request, self.tokens[self.user])
     response = unsubscribe(request, self.tokens[self.user])
     self.assertEqual(response.status_code, 200)
     self.assertNotPrefExists(self.user)
Exemple #3
0
 def test_user(user):
     request = self.request_factory.get("dummy")
     request.user = AnonymousUser()
     response = unsubscribe(request, self.tokens[user])
     self.assertEqual(response.status_code, 200)
     self.assertNotPrefExists(user)
Exemple #4
0
 def test_unsubscribe_post(self):
     request = self.request_factory.post("dummy")
     response = unsubscribe(request, "dummy")
     self.assertEqual(response.status_code, 405)
Exemple #5
0
 def test_user(user):
     request = self.request_factory.get("dummy")
     request.user = AnonymousUser()
     response = unsubscribe(request, self.tokens[user])
     self.assertEqual(response.status_code, 200)
     self.assertNotPrefExists(user)
Exemple #6
0
 def test_unsubscribe_post(self):
     request = self.request_factory.post("dummy")
     response = unsubscribe(request, "dummy")
     self.assertEqual(response.status_code, 405)