'Make sure we can\'t make unexpected status transitions.
The status transitions we expect are::
â â â must_retry
created â ready â submitted â approved
â â â  denied'

def test_state_transitions(self):

    user = UserFactory.create()
    attempt = SoftwareSecurePhotoVerification(user=user)
    assert_equals(attempt.status, 'created')
    assert_raises(VerificationException, attempt.submit)
    assert_raises(VerificationException, attempt.approve)
    assert_raises(VerificationException, attempt.deny)
    attempt.mark_ready()
    assert_equals(attempt.status, 'ready')
    assert_raises(VerificationException, attempt.approve)
    assert_raises(VerificationException, attempt.deny)
    DENY_ERROR_MSG = '[{"photoIdReasons":    ["Not    provided"]}]'
    attempt.status = 'must_retry'
    attempt.system_error('System    error')
    attempt.approve()
    attempt.status = 'must_retry'
    attempt.deny(DENY_ERROR_MSG)
    attempt.status = 'submitted'
    attempt.deny(DENY_ERROR_MSG)
    attempt.status = 'submitted'
    attempt.approve()
    assert_raises(VerificationException, attempt.submit)
    attempt.approve()
    attempt.system_error('System    error')
    attempt.deny(DENY_ERROR_MSG)
    assert_raises(VerificationException, attempt.submit)
    attempt.deny(DENY_ERROR_MSG)
    attempt.system_error('System    error')
    attempt.approve()
