示例#1
0
    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')
示例#2
0
    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')
示例#3
0
    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())
示例#4
0
    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())