File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
1
# Pytest for running the tests.
2
- pytest>=4. 5.0,<4.6
3
- pytest-django>=3.4.8 ,<3.5
2
+ pytest>=5.0,<5.1
3
+ pytest-django>=3.5.1 ,<3.6
4
4
pytest-cov>=2.7.1
Original file line number Diff line number Diff line change @@ -533,11 +533,13 @@ class MockUser:
533
533
is_active = False
534
534
old_authenticate = authentication .authenticate
535
535
authentication .authenticate = lambda ** kwargs : MockUser ()
536
- auth = authentication .BasicAuthentication ()
537
- with pytest .raises (exceptions .AuthenticationFailed ) as error :
538
- auth .authenticate_credentials ('foo' , 'bar' )
539
- assert 'User inactive or deleted.' in str (error )
540
- authentication .authenticate = old_authenticate
536
+ try :
537
+ auth = authentication .BasicAuthentication ()
538
+ with pytest .raises (exceptions .AuthenticationFailed ) as exc_info :
539
+ auth .authenticate_credentials ('foo' , 'bar' )
540
+ assert 'User inactive or deleted.' in str (exc_info .value )
541
+ finally :
542
+ authentication .authenticate = old_authenticate
541
543
542
544
543
545
@override_settings (ROOT_URLCONF = __name__ ,
You can’t perform that action at this time.
0 commit comments