l.a.t.t.ConfirmAnswerTestCase(BaseAnswerTrackerWorkflowTestCase) : class documentation

Part of lp.answers.tests.test_question_workflow View In Hierarchy

Test cases for the confirmAnswer() workflow action method.
Method test_can_confirm_answer_without_answer Test the can_confirm_answer attribute when no answer was posted.
Method test_can_confirm_answer_with_answer Test that can_confirm_answer when there is an answer present.
Method test_confirmAnswerFromInvalidStates_without_answer Test calling confirmAnswer from invalid states.
Method test_confirmAnswerFromInvalidStates_with_answer Test calling confirmAnswer from invalid states with an answer.
Method test_confirmAnswerBeforeSOLVED Test confirmAnswer().
Method test_confirmAnswerAfterSOLVED Test confirmAnswer().
Method testCannotConfirmAnAnswerFromAnotherQuestion Test that you can't confirm an answer from a different question.
Method test_confirmAnswerPermission Test that only the owner can access confirmAnswer().

Inherited from BaseAnswerTrackerWorkflowTestCase:

Method setUp Undocumented
Method tearDown Undocumented
Method setQuestionStatus Utility metho to change a question status.
Method setUpEventListeners Install a listener for events emitted during the test.
Method collectEvent Collect events
Method nowPlus Return a DateTime a number of hours in the future.
Method checkTransitionMessage Helper method to check the message created by a transition.
Method checkTransitionEvents Helper method to validate the events triggered from the transition.
Method _testTransitionGuard Helper for transition guard tests.
Method _testValidTransition Helper for testing valid state transitions.
Method _testInvalidTransition Helper for testing invalid transitions.
def test_can_confirm_answer_without_answer(self):
Test the can_confirm_answer attribute when no answer was posted.

When the question didn't receive an answer, it should always be false.

def test_can_confirm_answer_with_answer(self):
Test that can_confirm_answer when there is an answer present.

Once one answer was given, it becomes possible in some states.

def test_confirmAnswerFromInvalidStates_without_answer(self):
Test calling confirmAnswer from invalid states.

confirmAnswer() cannot be called when the question has no message with action ANSWER.

def test_confirmAnswerFromInvalidStates_with_answer(self):
Test calling confirmAnswer from invalid states with an answer.

When the question has a message with action ANSWER, confirmAnswer() can only be called when it is in the OPEN, NEEDSINFO, or ANSWERED state.

def test_confirmAnswerBeforeSOLVED(self):
Test confirmAnswer().

Test that confirmAnswer() can be called when the question status is one of OPEN, NEEDSINFO, ANSWERED and that it has at least one ANSWER message and check that it returns a valid IQuestionMessage.

def test_confirmAnswerAfterSOLVED(self):
Test confirmAnswer().

Test that confirmAnswer() can be called when the question status is SOLVED, and that it has at least one ANSWER message and check that it returns a valid IQuestionMessage.

def testCannotConfirmAnAnswerFromAnotherQuestion(self):
Test that you can't confirm an answer from a different question.
def test_confirmAnswerPermission(self):
Test that only the owner can access confirmAnswer().
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.