diff --git a/hordak/tests/admin/test_admin.py b/hordak/tests/admin/test_admin.py index 2639769..78f69bc 100644 --- a/hordak/tests/admin/test_admin.py +++ b/hordak/tests/admin/test_admin.py @@ -57,6 +57,29 @@ def test_search_query(self): '?_changelist_filters=q%3DBank">Bank account', html=True, ) + self.assertContains(res, '

1 account

', html=True) + + def test_filter_query(self): + """Test that filter 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 + "?type__exact=AS") + self.assertContains( + res, + f'Bank account', + html=True, + ) + self.assertContains(res, '

1 account

', html=True) + + def test_filter_query_liability(self): + """Test that filter 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 + "?type__exact=LI") + self.assertContains(res, '

0 accounts

', html=True) def test_account_edit(self): """Test account edit page"""