コード例 #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
ファイル: test_views.py プロジェクト: icereval/osf.io
    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
ファイル: test_views.py プロジェクト: jwalz/osf.io
    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())