We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a99a6ff commit 1019cc7Copy full SHA for 1019cc7
1 file changed
tests/tests/tests.py
@@ -2,6 +2,7 @@
2
3
from unittest import skipIf, skipUnless
4
5
+import django
6
from django.core import mail
7
8
from django.test import TestCase
@@ -257,7 +258,15 @@ def test_better_readonly_password_widget(self):
257
258
form = UserChangeForm(instance=user)
259
260
self.assertIn(_('*************'), form.as_table())
- self.assertIn('<a class="button"', form.as_table())
261
+
262
+ version = django.VERSION[0]
263
264
+ if version < 4:
265
+ self.assertIn('<a href="../password/">', form.as_table())
266
+ elif version < 5:
267
+ self.assertIn('<a href="../../{0}/password/">'.format(user.id), form.as_table())
268
+ else:
269
+ self.assertIn('<a class="button" href="../password/">', form.as_table())
270
271
272
class UserAdminTest(TestCase):
0 commit comments