def test_timer_not_running_when_stopped(self):
     user_timer = UserTimer(self.user, db)
     assert(user_timer.timer_get() is None)
     timer = user_timer.timer_create()
     timer.start()
     timer.stop()
     assert(not timer.is_running())
 def test_can_create_timer_on_user_timer(self):
     assert(self.user.timer is None)
     user_timer = UserTimer(self.user, db)
     timer = user_timer.timer_create()
     assert(self.user.timer is not None)
     assert(timer is not None)
     assert(timer.userId is not None)
 def test_can_create_john_timer(self):
     query_result = User.objects(email="*****@*****.**")
     u = query_result.first()
     user_timer = UserTimer(u, db)
     timer = user_timer.timer_create()
     timer.set_seconds_today(300)
     timer.notes = "John's perpetual timer"
     timer.start()
     timer.save()
 def test_can_restart_timer(self):
     user_timer = UserTimer(self.user, db)
     assert(user_timer.timer_get() is None)
     timer = user_timer.timer_create()
     timer.start()
     timer.stop()
     assert(not timer.is_running())
     timer.start()
     assert(timer.is_running())
     timer.stop()
     assert(not timer.is_running())