Skip to content

Commit

Permalink
Use six.assertRaisesRegex shim in YubiKeyTest
Browse files Browse the repository at this point in the history
Prevents a DprecationWarning due to older Django releases calling
TestCase.assertRaisesRegexp() with callable=None.

Also presents a DeprecationWarning on Python 3.4, due to (indirectly)
calling TestCase.assertRaisesRegex**p**().
  • Loading branch information
moreati committed Jul 7, 2015
1 parent bca9545 commit e5460d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,8 @@ def test_setup(self, verify_token):
self.assertContains(response, 'YubiKey')

# Without ValidationService it won't work
with self.assertRaisesMessage(KeyError, "No ValidationService found with name 'default'"):
with six.assertRaisesRegex(self, KeyError,
"No ValidationService found with name 'default'"):
self.client.post(reverse('two_factor:setup'),
data={'setup_view-current_step': 'method',
'method-method': 'yubikey'})
Expand Down

0 comments on commit e5460d2

Please sign in to comment.