示例#1
0
    def test_confirm_registration_as_ham(self):
        view = NodeConfirmHamView()
        view = setup_log_view(view, self.request, guid=self.registration._id)
        view.delete(self.request)

        self.registration.refresh_from_db()
        nt.assert_true(self.registration.spam_status == 4)
示例#2
0
    def test_confirm_node_as_ham(self):
        view = NodeConfirmHamView()
        view = setup_log_view(view, self.request, guid=self.node._id)
        view.post(self.request)

        self.node.refresh_from_db()
        nt.assert_true(self.node.spam_status == 4)
示例#3
0
    def test_confirm_registration_as_ham(self):
        view = NodeConfirmHamView()
        view = setup_log_view(view, self.request, guid=self.registration._id)
        view.delete(self.request)

        self.registration.refresh_from_db()
        nt.assert_true(self.registration.spam_status == 4)
示例#4
0
    def test_confirm_registration_as_ham(self):
        view = NodeConfirmHamView()
        view = setup_log_view(view, self.request, guid=self.registration._id)
        resp = view.post(self.request)

        nt.assert_true(resp.status_code == 302)

        self.registration.refresh_from_db()
        nt.assert_false(self.registration.is_public)
        nt.assert_true(self.registration.spam_status == 4)