daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class TestUtils(APITestCase):
  2.     def test_unique_device_code(self):
  3.         first_code = id_generator()
  4.         second_code = id_generator()
  5.  
  6.         self.assertNotEqual(first_code, second_code)
  7.  
  8.     def test_device_code_len(self):
  9.         first_code = id_generator(100)
  10.         second_code = id_generator(1)
  11.  
  12.         self.assertEqual(len(first_code), 100)
  13.         self.assertEqual(len(second_code), 1)
  14.  
  15.  
  16. class TestSprinkleScheduleOperations(APITestCase):
  17.  
  18.     def test_initial_schedule(self):
  19.         user = User.objects.create_user('any_user', password='randomString')
  20.         device = Device(name='one_device', owner=user)
  21.         schedule_parameters = {
  22.             'device': device,
  23.             'hour': 10,
  24.             'minute': 12,
  25.             'am_pm': 'am',
  26.             'on_monday': True,
  27.             'on_tuesday': True,
  28.             'on_wednesday': True,
  29.             'on_thursday': True,
  30.             'on_friday': True,
  31.             'on_saturday': True,
  32.             'on_sunday': True,
  33.         }
  34.         hello = SprinkleSchedule(**schedule_parameters)
  35.         next_schedule = hello.next_day()
  36.         print(next_schedule)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top