def test_restart_stuck_registration(self): view = RestartStuckRegistrationsView() view = setup_log_view(view, self.request, guid=self.registration._id) nt.assert_equal(self.registration.archive_job.status, u'INITIATED') from django.contrib.messages.storage.fallback import FallbackStorage # django.contrib.messages has a bug which effects unittests # more info here -> https://code.djangoproject.com/ticket/17971 setattr(self.request, 'session', 'session') messages = FallbackStorage(self.request) setattr(self.request, '_messages', messages) view.post(self.request) nt.assert_equal(self.registration.archive_job.status, u'SUCCESS')
def test_get_object(self): view = RestartStuckRegistrationsView() view = setup_log_view(view, self.request, guid=self.registration._id) nt.assert_true(self.registration, view.get_object())