tests.py 539 B

12345678910111213
  1. from django.test import TestCase, Client
  2. from django.urls import reverse
  3. class LoggerTest(TestCase):
  4. def test_create_should_not_be_public(self):
  5. client = Client(HTTP_HOST="127.0.0.1:8001")
  6. response = client.post("/arduino/markers/create", {'abc': []}, content_type="application/json")
  7. self.assertEqual(response.status_code, 302)
  8. def test_censor_should_not_be_public(self):
  9. client = Client(HTTP_HOST="127.0.0.1:8001")
  10. response = client.get("/arduino/markers/censor")
  11. self.assertEqual(response.status_code, 302)