Ejemplo n.º 1
0
 def test_ajax_disable_success(self):
     self.create_prefs()
     request = self.request_factory.post("dummy")
     request.user = self.user
     response = ajax_disable(request)
     self.assertEqual(response.status_code, 204)
     self.assertNotPrefExists(self.user)
Ejemplo n.º 2
0
 def test_ajax_disable_get(self):
     self.create_prefs()
     request = self.request_factory.get("dummy")
     request.user = self.user
     response = ajax_disable(request)
     self.assertEqual(response.status_code, 405)
     self.assertPrefValid(self.user)
Ejemplo n.º 3
0
 def test_ajax_disable_already_disabled(self):
     request = self.request_factory.post("dummy")
     request.user = self.user
     response = ajax_disable(request)
     self.assertEqual(response.status_code, 204)
     self.assertNotPrefExists(self.user)