tests.py 853 B

12345678910111213141516171819202122
  1. from django.test import TestCase, Client
  2. class StammbaumTest(TestCase):
  3. def test_view_should_not_be_public(self):
  4. client = Client(HTTP_HOST="127.0.0.1:8001")
  5. response = client.get("/stammbaum/")
  6. self.assertEqual(response.status_code, 403)
  7. def test_preview_should_not_be_public(self):
  8. client = Client(HTTP_HOST="127.0.0.1:8001")
  9. response = client.get("/stammbaum/person/1/thumb")
  10. self.assertEqual(response.status_code, 301)
  11. def test_image_should_not_be_public(self):
  12. client = Client(HTTP_HOST="127.0.0.1:8001")
  13. response = client.get("/stammbaum/person/1/image")
  14. self.assertEqual(response.status_code, 301)
  15. def test_upload_should_not_be_public(self):
  16. client = Client(HTTP_HOST="127.0.0.1:8001")
  17. response = client.post("/stammbaum/person/1/upload")
  18. self.assertEqual(response.status_code, 301)