mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-23 01:32:25 +02:00
Add non-prod banner
This commit is contained in:
parent
10aa1c8e59
commit
ad6d080ad9
5 changed files with 93 additions and 29 deletions
29
src/registrar/tests/test_environment_variables_effects.py
Normal file
29
src/registrar/tests/test_environment_variables_effects.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
from django.test import Client, TestCase, override_settings
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
|
||||
class MyTestCase(TestCase):
|
||||
def setUp(self):
|
||||
self.client = Client()
|
||||
username = "test_user"
|
||||
first_name = "First"
|
||||
last_name = "Last"
|
||||
email = "info@example.com"
|
||||
self.user = get_user_model().objects.create(
|
||||
username=username, first_name=first_name, last_name=last_name, email=email
|
||||
)
|
||||
self.client.force_login(self.user)
|
||||
|
||||
def tearDown(self):
|
||||
super().tearDown()
|
||||
self.user.delete()
|
||||
|
||||
@override_settings(IS_PRODUCTION=True)
|
||||
def test_production_environment(self):
|
||||
home_page = self.client.get("/")
|
||||
self.assertNotContains(home_page, "You are not on production.")
|
||||
|
||||
@override_settings(IS_PRODUCTION=False)
|
||||
def test_non_production_environment(self):
|
||||
home_page = self.client.get("/")
|
||||
self.assertContains(home_page, "You are not on production.")
|
Loading…
Add table
Add a link
Reference in a new issue