diff --git a/tests/authentication/test_authentication.py b/tests/authentication/test_authentication.py index 40df2cdc8..37e265e17 100644 --- a/tests/authentication/test_authentication.py +++ b/tests/authentication/test_authentication.py @@ -535,9 +535,9 @@ class BasicAuthenticationUnitTests(TestCase): authentication.authenticate = lambda **kwargs: MockUser() try: auth = authentication.BasicAuthentication() - with pytest.raises(exceptions.AuthenticationFailed) as error: + with pytest.raises(exceptions.AuthenticationFailed) as exc_info: auth.authenticate_credentials('foo', 'bar') - assert 'User inactive or deleted.' in str(error) + assert 'User inactive or deleted.' in str(exc_info.value) finally: authentication.authenticate = old_authenticate