def test_add_with_empty_to_add_list(self): """ Test what happens when we run ``App.add()`` with an empty to_add list. Calling this method with a list only happens inside ``App.update()``, and that method checks for an empty list before calling, so this should never actually happen in "real life," but we'll check it anyway. """ retlines = list(App.add([])) self.assertEqual(retlines, []) self.assertEqual(Artist.objects.count(), 0) self.assertEqual(Album.objects.count(), 0) self.assertEqual(Song.objects.count(), 0)
def run_add_errors(self, errors_min=1, error=None): """ Runs an ``add`` operation on our library, and expect to see at least one error. """ return self.assertErrors(list(App.add()), errors_min, error=error)
def run_add(self): """ Runs an ``add`` operation on our library, and checks for errors. """ return self.assertNoErrors(list(App.add()))