Part of lp.answers.tests.test_question_workflow View In Hierarchy
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. |
When the question didn't receive an answer, it should always be false.
Once one answer was given, it becomes possible in some states.
confirmAnswer() cannot be called when the question has no message with action 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.
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.
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.