def test_uniquess_to_a_point(self): seen = {} for _ in range(10000): nonce = utils.make_nonce() self.assertTrue(nonce not in seen) seen[nonce] = True
def test_make_nonce(self): nonce = utils.make_nonce() self.assertRegexpMatches( nonce, r'^001' r'[2-9][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])' r'T([01][0-9]|2[0-3])(:[0-5][0-9]){2}Z' r'[A-Za-z0-9]{6}$' )