Exemplo n.º 1
0
 def test_doesnt_reuse_a_key(self):
     number_of_possible_keys = len(string.ascii_uppercase + string.digits)
     keys = []
     for i in range(1, number_of_possible_keys):
         key = fixed_quiz.get_unique_quiz_key(1)
         Quiz.objects.create(key=key)
         self.assertNotIn(key, keys)
         keys.append(key)
Exemplo n.º 2
0
 def test_doesnt_reuse_a_key(self):
     number_of_possible_keys = len(string.ascii_uppercase + string.digits)
     keys = []
     for i in range(1, number_of_possible_keys):
         key  = fixed_quiz.get_unique_quiz_key(1)
         Quiz.objects.create(key=key)
         self.assertNotIn(key, keys)
         keys.append(key)
Exemplo n.º 3
0
 def test_returns_random_string(self):
     key = fixed_quiz.get_unique_quiz_key(5)
     self.assertEqual(5, len(key))
     self.assertEqual(type(''), type(key))
Exemplo n.º 4
0
 def test_returns_random_string(self):
     key = fixed_quiz.get_unique_quiz_key(5)
     self.assertEqual(5, len(key))
     self.assertEqual(type(''), type(key))