You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
661 B

10 years ago
10 years ago
10 years ago
  1. from django.test import TestCase
  2. from django.test.utils import override_settings
  3. class BasicsTestCase(TestCase):
  4. def test_it_shows_welcome(self):
  5. r = self.client.get("/")
  6. self.assertContains(r, "Get Notified", status_code=200)
  7. self.assertNotContains(r, "do not use in production")
  8. @override_settings(DEBUG=True)
  9. def test_it_shows_debug_warning(self):
  10. r = self.client.get("/")
  11. self.assertContains(r, "do not use in production")
  12. @override_settings(REGISTRATION_OPEN=False)
  13. def test_it_obeys_registration_open(self):
  14. r = self.client.get("/")
  15. self.assertNotContains(r, "Get Started")