1
0
mirror of https://github.com/django/django.git synced 2025-05-29 10:16:30 +00:00

Refs #32539 -- Fixed facet filter tests on Oracle.

Follow up to 868e2fcddae6720d5713924a785339d1665f1bb9.
This commit is contained in:
Mariusz Felisiak 2023-03-05 13:19:09 +01:00 committed by GitHub
parent 61f599aeb9
commit 2660bc19f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,7 @@ from django.contrib.admin.options import IncorrectLookupParameters, ShowFacets
from django.contrib.auth.admin import UserAdmin from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.db import connection
from django.test import RequestFactory, SimpleTestCase, TestCase, override_settings from django.test import RequestFactory, SimpleTestCase, TestCase, override_settings
from .models import Book, Bookmark, Department, Employee, ImprovedBook, TaggedItem 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(["This month (2)", "This year (2)"])
expected_date_filters.extend(["No date (1)", "Has date (3)"]) 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 = [ tests = [
# RelatedFieldListFilter. # RelatedFieldListFilter.
["All", "alfred (2)", "bob (1)", "lisa (0)", "??? (1)"], ["All", "alfred (2)", "bob (1)", "lisa (0)", "??? (1)"],
@ -1378,8 +1382,8 @@ class ListFiltersTests(TestCase):
"All", "All",
"Non-Fictional (1)", "Non-Fictional (1)",
"Fictional (1)", "Fictional (1)",
"We don't know (1)", f"We don't know ({empty_choice_count})",
"Not categorized (1)", f"Not categorized ({empty_choice_count})",
], ],
# DateFieldListFilter. # DateFieldListFilter.
expected_date_filters, expected_date_filters,