예제 #1
0
 def test_lucky_return_different_result_on_different_request(self):
     self._add_file('a.jpg')
     self._add_file('b.jpg')
     _1st = lucky()
     _2nd = lucky()
     self.assertNotEqual(_1st, None)
     self.assertNotEqual(_2nd, None)
     self.assertNotEqual(_1st, _2nd)
예제 #2
0
 def test_lucky_return_None_if_no_more_file(self):
     self._add_file('a.jpg')
     self._add_file('b.jpg')
     lucky()
     lucky()
     self.assertEqual(lucky(), None)
예제 #3
0
 def test_lucky_return_file_path_if_one_file(self):
     self._add_file('a.jpg')
     self.assertEqual(lucky(), 'upload/a.jpg')
예제 #4
0
 def test_lucky_return_None_if_no_file(self):
     self.assertEqual(lucky(), None)