示例#1
0
    def test_update_nonce(self):
        tony = User(email_validated=False)
        tony.update_validation_nonce(Purpose.registration, 2)

        def change_email():
            tony.update_validation_nonce(Purpose.change_email, 2)
        self.assertRaisesRegexp(
            Exception, 'Account not validated', change_email)

        tony.email_validated = True
        change_email()