def test_get_disabled_activity(self): a1 = Activity(title="activity 1", color=Color("#ffffff")) quarterapp.storage.add_activity(self.db, BOB_THE_USER, a1) a1.disable() quarterapp.storage.update_activity(self.db, BOB_THE_USER, a1) activities = quarterapp.storage.get_disabled_activities(self.db, BOB_THE_USER) self.assertEqual(1, len(activities))
def test_disable_activity(self): a1 = Activity(title="Activity 444", color=Color("#ccc")) activity = quarterapp.storage.add_activity(self.db, BOB_THE_USER, a1) activity = quarterapp.storage.get_activity(self.db, BOB_THE_USER, activity.id) self.assertEqual(activity.title, "Activity 444") a1.title = "Activity 4" a1.disable() quarterapp.storage.update_activity(self.db, BOB_THE_USER, a1) activity = quarterapp.storage.get_activity(self.db, BOB_THE_USER, activity.id) self.assertTrue(activity.disabled())
def test_get_activity(self): a1 = Activity(title="Activity 444", color=Color("#ccc")) quarterapp.storage.add_activity(self.db, BOB_THE_USER, a1) activity = quarterapp.storage.get_activity(self.db, BOB_THE_USER, a1.id) self.assertEqual(activity.title, "Activity 444") a1.title = "Activity 4" quarterapp.storage.update_activity(self.db, BOB_THE_USER, a1) activity = quarterapp.storage.get_activity(self.db, BOB_THE_USER, a1.id) self.assertEqual(activity.title, "Activity 4") self.assertEqual(activity.color.hex(), "#ccc")