def test_quarantine(self): """ Test that quarantining a session adds the correct flags, and that lifting the quarantine similarly removes those flags. """ request = mock.MagicMock( session={} ) pipeline.quarantine_session(request, locations=('my_totally_real_module', 'other_real_module',)) self.assertEqual( request.session['third_party_auth_quarantined_modules'], ('my_totally_real_module', 'other_real_module',), ) pipeline.lift_quarantine(request) self.assertNotIn('third_party_auth_quarantined_modules', request.session)
def lift_quarantine(request): """ Remove the quarantine session variable. """ lift_quarantine(request)