comparison bio/tests/test_views.py @ 1206:02181fa5ac9d modernize tip

Update to Django 1.9.
author Brian Neal <bgneal@gmail.com>
date Wed, 22 Jan 2025 17:58:16 -0600 (14 hours ago)
parents 9e803323a0d0
children
comparison
equal deleted inserted replaced
1205:510ef3cbf3e6 1206:02181fa5ac9d
42 {'username': self.USERNAME}, 42 {'username': self.USERNAME},
43 follow=True) 43 follow=True)
44 44
45 self.assertEqual(len(response.redirect_chain), 1) 45 self.assertEqual(len(response.redirect_chain), 1)
46 if response.redirect_chain: 46 if response.redirect_chain:
47 self.assertEqual(response.redirect_chain[0][0], 47 self.assertEqual(
48 'http://testserver' + reverse('bio-view_profile', 48 response.redirect_chain[0][0],
49 reverse(
50 'bio-view_profile',
49 kwargs={'username': self.USERNAME})) 51 kwargs={'username': self.USERNAME}))
50 self.assertEqual(response.redirect_chain[0][1], 302) 52 self.assertEqual(response.redirect_chain[0][1], 302)
51 53
52 self.assertEqual(response.status_code, 200) 54 self.assertEqual(response.status_code, 200)
53 55
74 except NoReverseMatch: 76 except NoReverseMatch:
75 self.fail('bit by a MySQL bug?') 77 self.fail('bit by a MySQL bug?')
76 78
77 self.assertEqual(len(response.redirect_chain), 1) 79 self.assertEqual(len(response.redirect_chain), 1)
78 if response.redirect_chain: 80 if response.redirect_chain:
79 self.assertEqual(response.redirect_chain[0][0], 81 self.assertEqual(
80 'http://testserver' + reverse('bio-view_profile', 82 response.redirect_chain[0][0],
83 reverse(
84 'bio-view_profile',
81 kwargs={'username': self.USERNAME})) 85 kwargs={'username': self.USERNAME}))
82 self.assertEqual(response.redirect_chain[0][1], 302) 86 self.assertEqual(response.redirect_chain[0][1], 302)
83 87
84 self.assertEqual(response.status_code, 200) 88 self.assertEqual(response.status_code, 200)
85 89