summaryrefslogtreecommitdiff
path: root/tests/admin_filters
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-03-05 13:19:09 +0100
committerGitHub <noreply@github.com>2023-03-05 13:19:09 +0100
commit2660bc19f396b0aa74b11e00452ad39df0dba825 (patch)
tree195a1cf13a149481b72570d6773d4ba2bc382f24 /tests/admin_filters
parent61f599aeb991095baa510225a4adeee91d0d43cc (diff)
downloaddjango-2660bc19f396b0aa74b11e00452ad39df0dba825.tar.gz
Refs #32539 -- Fixed facet filter tests on Oracle.
Follow up to 868e2fcddae6720d5713924a785339d1665f1bb9.
Diffstat (limited to 'tests/admin_filters')
-rw-r--r--tests/admin_filters/tests.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/admin_filters/tests.py b/tests/admin_filters/tests.py
index b7b1aa6b83..f865f2dd4a 100644
--- a/tests/admin_filters/tests.py
+++ b/tests/admin_filters/tests.py
@@ -17,6 +17,7 @@ from django.contrib.admin.options import IncorrectLookupParameters, ShowFacets
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
+from django.db import connection
from django.test import RequestFactory, SimpleTestCase, TestCase, override_settings
from .models import Book, Bookmark, Department, Employee, ImprovedBook, TaggedItem
@@ -1360,6 +1361,9 @@ class ListFiltersTests(TestCase):
expected_date_filters.extend(["This month (2)", "This year (2)"])
expected_date_filters.extend(["No date (1)", "Has date (3)"])
+ empty_choice_count = (
+ 2 if connection.features.interprets_empty_strings_as_nulls else 1
+ )
tests = [
# RelatedFieldListFilter.
["All", "alfred (2)", "bob (1)", "lisa (0)", "??? (1)"],
@@ -1378,8 +1382,8 @@ class ListFiltersTests(TestCase):
"All",
"Non-Fictional (1)",
"Fictional (1)",
- "We don't know (1)",
- "Not categorized (1)",
+ f"We don't know ({empty_choice_count})",
+ f"Not categorized ({empty_choice_count})",
],
# DateFieldListFilter.
expected_date_filters,