File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -257,13 +257,16 @@ def test_better_readonly_password_widget(self):
257257 user = User .objects .get (username = 'testclient' )
258258 form = UserChangeForm (instance = user )
259259
260- self .assertIn (_ ('*************' ), form .as_table ())
260+ html = form .as_table ()
261+ self .assertIn (_ ('*************' ), html )
261262 version = django .VERSION [:2 ]
262263
263- if version in ((4 , 2 ), (5 , 0 )):
264- self .assertIn ('<a href="../../{0}/password/">' .format (user .id ), form .as_table ())
264+ if version < (4 , 2 ):
265+ self .assertIn ('<a href="../password/"' , html )
266+ elif version < (5 , 1 ):
267+ self .assertIn ('<a href="../../{0}/password/">' .format (user .id ), html )
265268 else :
266- self .assertIn ('<a href="../password/"' , form . as_table () )
269+ self .assertIn ('<a href="../password/" class="button" ' , html )
267270
268271
269272class UserAdminTest (TestCase ):
You can’t perform that action at this time.
0 commit comments