예제 #1
0
 def test_combination_has_valid_char(self):
     code = Code()
     allowed_chars = code.allowed_chars
     override_code = SimpleOverride(request_code='624FZ').override_code
     self.assertIsNotNone(override_code)
     for c in override_code:
         self.assertIn(c, allowed_chars)
     for c in code.decode(override_code):
         self.assertIn(c, allowed_chars)
예제 #2
0
 def test_code_validated(self):
     code = Code()
     plain_code = str(code)
     validation_code = code.validation_code
     code = Code(plain_code)
     self.assertTrue(code.validate(validation_code))
예제 #3
0
 def test_code_not_validated(self):
     code = Code('AAAAA')
     self.assertFalse(code.validate(None))