def test_task_delete(self): task1 = Task.create(total=1) task2 = Task.create(total=2) self.assertTrue(Task.delete(task1.id)) self.assertFalse(Task.find_recent(task1.id)) self.assertTrue(Task.find_recent(task2.id)) with self.assertRaises(TypeError): Task.delete('asdasd')
def test_task_find(self): task = Task.create(total=100) found = Task.find_recent(task.id) self.assertTrue(task.id is found.id) self.assertFalse(Task.find_recent(10)) with self.assertRaises(TypeError): Task.find_recent('asdasd')