From 109ed08c51db8d591bf38ca46b6dfd3a1dc90043 Mon Sep 17 00:00:00 2001 From: David Farrington Date: Tue, 8 Oct 2024 17:59:24 +0100 Subject: [PATCH] Fix tests --- tests/test_admin_views.py | 6 +++--- tests/utils.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_admin_views.py b/tests/test_admin_views.py index 7a7b9e12..3e9817c1 100644 --- a/tests/test_admin_views.py +++ b/tests/test_admin_views.py @@ -208,10 +208,10 @@ def test_detail(admin_client): "admin/widgets/foreign_key_raw_id.html": 1, "admin/widgets/related_widget_wrapper.html": 4, "admin/widgets/split_datetime.html": 2, - "django/forms/widgets/attrs.html": 47, + "django/forms/widgets/attrs.html": 47 if django.VERSION < (5, 0, 0) else 49, "django/forms/widgets/date.html": 5, - "django/forms/widgets/hidden.html": 6, - "django/forms/widgets/input.html": 19, + "django/forms/widgets/hidden.html": 6 if django.VERSION < (5, 0, 0) else 8, + "django/forms/widgets/input.html": 19 if django.VERSION < (5, 0, 0) else 21, "django/forms/widgets/number.html": 1, "django/forms/widgets/select.html": 6, "django/forms/widgets/select_option.html": 21, diff --git a/tests/utils.py b/tests/utils.py index 74a850f8..a4521103 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -36,7 +36,7 @@ def parse_topmenu(response): anchor = li.find("a") # Skip brand link and menu button - if type(anchor.contents[0]) == Tag: + if isinstance(anchor.contents[0], Tag): continue item = {"name": anchor.text.strip(), "link": anchor["href"]}