mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-19 17:25:56 +02:00
cleanup of debugging on failing test outside of scope of this ticket
This commit is contained in:
parent
64c936b553
commit
2b3c7ae0fd
1 changed files with 33 additions and 33 deletions
|
@ -1816,41 +1816,41 @@ class ListHeaderAdminTest(TestCase):
|
|||
self.superuser = create_superuser()
|
||||
|
||||
def test_changelist_view(self):
|
||||
# with less_console_noise():
|
||||
# Have to get creative to get past linter
|
||||
p = "adminpass"
|
||||
self.client.login(username="superuser", password=p)
|
||||
# Mock a user
|
||||
user = mock_user()
|
||||
# Make the request using the Client class
|
||||
# which handles CSRF
|
||||
# Follow=True handles the redirect
|
||||
response = self.client.get(
|
||||
"/admin/registrar/domainapplication/",
|
||||
{
|
||||
"status__exact": "started",
|
||||
"investigator__id__exact": user.id,
|
||||
"q": "Hello",
|
||||
},
|
||||
follow=True,
|
||||
)
|
||||
# Assert that the filters and search_query are added to the extra_context
|
||||
self.assertIn("filters", response.context)
|
||||
self.assertIn("search_query", response.context)
|
||||
# Assert the content of filters and search_query
|
||||
filters = response.context["filters"]
|
||||
search_query = response.context["search_query"]
|
||||
self.assertEqual(search_query, "Hello")
|
||||
self.assertEqual(
|
||||
filters,
|
||||
[
|
||||
{"parameter_name": "status", "parameter_value": "started"},
|
||||
with less_console_noise():
|
||||
# Have to get creative to get past linter
|
||||
p = "adminpass"
|
||||
self.client.login(username="superuser", password=p)
|
||||
# Mock a user
|
||||
user = mock_user()
|
||||
# Make the request using the Client class
|
||||
# which handles CSRF
|
||||
# Follow=True handles the redirect
|
||||
response = self.client.get(
|
||||
"/admin/registrar/domainapplication/",
|
||||
{
|
||||
"parameter_name": "investigator",
|
||||
"parameter_value": user.first_name + " " + user.last_name,
|
||||
"status__exact": "started",
|
||||
"investigator__id__exact": user.id,
|
||||
"q": "Hello",
|
||||
},
|
||||
],
|
||||
)
|
||||
follow=True,
|
||||
)
|
||||
# Assert that the filters and search_query are added to the extra_context
|
||||
self.assertIn("filters", response.context)
|
||||
self.assertIn("search_query", response.context)
|
||||
# Assert the content of filters and search_query
|
||||
filters = response.context["filters"]
|
||||
search_query = response.context["search_query"]
|
||||
self.assertEqual(search_query, "Hello")
|
||||
self.assertEqual(
|
||||
filters,
|
||||
[
|
||||
{"parameter_name": "status", "parameter_value": "started"},
|
||||
{
|
||||
"parameter_name": "investigator",
|
||||
"parameter_value": user.first_name + " " + user.last_name,
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
def test_get_filters(self):
|
||||
with less_console_noise():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue