From 457af083d560c872aadbf0eec56fff1b10279b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Tue, 28 May 2024 14:19:49 +0200 Subject: [PATCH] add test for admin search --- hordak/tests/admin/test_admin.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hordak/tests/admin/test_admin.py b/hordak/tests/admin/test_admin.py index b9b9a5d..2639769 100644 --- a/hordak/tests/admin/test_admin.py +++ b/hordak/tests/admin/test_admin.py @@ -45,6 +45,19 @@ def test_account_list(self): self.assertContains(res, 'Income', html=True) self.assertContains(res, 'Asset', html=True) + def test_search_query(self): + """Test that search query works""" + superuser = get_user_model().objects.create_superuser(username="superuser") + self.client.force_login(superuser) + url = reverse("admin:hordak_account_changelist") + res = self.client.get(url + "?q=Bank") + self.assertContains( + res, + f'Bank account', + html=True, + ) + def test_account_edit(self): """Test account edit page""" superuser = get_user_model().objects.create_superuser(username="superuser")