def test_item_is_related_to_list(self): lst = List.objects.create() item = Item() item.lst = lst item.save() self.assertIn(item, lst.item_set.all())