def test_confirm_preprint_as_ham(self): view = views.PreprintConfirmHamView() view = setup_log_view(view, self.request, guid=self.preprint._id) view.delete(self.request) self.preprint.refresh_from_db() assert self.preprint.spam_status == 4
def test_confirm_preprint_as_ham(self, mock_akismet): request = RequestFactory().post('/fake_path') user = AuthUserFactory() preprint = PreprintFactory(creator=user) view = views.PreprintConfirmHamView() view = setup_log_view(view, request, guid=preprint._id) view.post(request) preprint.refresh_from_db() assert preprint.spam_status == 4
def test_confirm_ham(self, preprint, superuser, mock_akismet): request = RequestFactory().post('/fake_path') request.user = superuser view = views.PreprintConfirmHamView() view = setup_view(view, request, guid=preprint._id) view.post(request) preprint.refresh_from_db() assert preprint.spam_status == SpamStatus.HAM assert preprint.is_public