def test_get_all_tags_duplicates(self): store = TodoStore(self.db) store.initialize_db() tags = ['foo', 'bar', 'bam'] store.new_task(tags=tags) self.assertEqual(sorted(tags), sorted(store.get_all_tags())) tags2 = ['foo', 'sball'] store.new_task(tags=tags2) self.assertEqual(set(tags + tags2), set(store.get_all_tags()))
def test_get_all_tags(self): store = TodoStore(self.db) store.initialize_db() tags = ['foo', 'bar', 'bam'] task = store.new_task(tags=tags) self.assertEqual(sorted(tags), sorted(store.get_all_tags())) tags = ['foo', 'sball'] task.tags = tags store.save_task(task) self.assertEqual(sorted(tags), sorted(store.get_all_tags()))