Skip to content

Commit

Permalink
Refs #35090 -- Fixed urlpatterns.tests.SimplifiedURLTests when run in…
Browse files Browse the repository at this point in the history
… reverse.

Regression in 9cb1ffa.
  • Loading branch information
felixxm authored and sarahboyce committed Jan 16, 2025
1 parent 37373d9 commit a7af1e2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/urlpatterns/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
resolve,
reverse,
)
from django.urls.converters import IntConverter
from django.urls.converters import REGISTERED_CONVERTERS, IntConverter
from django.views import View

from .converters import Base64Converter, DynamicConverter
Expand Down Expand Up @@ -209,8 +209,12 @@ def test_warning_override_default_converter(self):

def test_warning_override_converter(self):
msg = "Converter 'base64' is already registered."
with self.assertRaisesMessage(ValueError, msg):
register_converter(Base64Converter, "base64")
try:
with self.assertRaisesMessage(ValueError, msg):
register_converter(Base64Converter, "base64")
register_converter(Base64Converter, "base64")
finally:
REGISTERED_CONVERTERS.pop("base64", None)

def test_invalid_view(self):
msg = "view must be a callable or a list/tuple in the case of include()."
Expand Down

0 comments on commit a7af1e2

Please sign in to comment.