def setUp(self): super().setUp() self.instance = FactoryFloor.FisheryFactory() self.test_url = reverse_lazy('fisheriescape:fishery_edit', args=[ self.instance.pk, ]) self.expected_template = 'fisheriescape/form.html' self.user = self.get_and_login_user(in_group="fisheriescape_admin")
def setUp(self): super().setUp() self.instance = FactoryFloor.SpeciesFactory() self.test_url = reverse_lazy('fisheriescape:species_delete', args=[ self.instance.pk, ]) self.expected_template = 'fisheriescape/confirm_delete.html' self.user = self.get_and_login_user(in_group="fisheriescape_admin")
def setUp(self): super().setUp() self.instance = FactoryFloor.SpeciesFactory() self.test_url = reverse_lazy('fisheriescape:species_new') self.expected_template = 'fisheriescape/form.html' self.user = self.get_and_login_user(in_group="fisheriescape_admin")
def setUp(self): super().setUp() self.instance = FactoryFloor.FisheryFactory() self.test_url = reverse_lazy('fisheriescape:fishery_list') self.expected_template = 'fisheriescape/list.html' self.user = self.get_and_login_user()
def setUp(self): super().setUp() self.instance = FactoryFloor.MarineMammalFactory()
def setUp(self): super().setUp() self.instance = FactoryFloor.FisheryAreaFactory()
def test_m2m_fishery_areas(self): # a `my_model` that is attached to a given `fishery_areas` should be accessible by the m2m field name `fishery_areas` fishery_areas = FactoryFloor.FisheryAreaFactory() self.instance.fishery_areas.add(fishery_areas) self.assertEqual(self.instance.fishery_areas.count(), 1) self.assertIn(fishery_areas, self.instance.fishery_areas.all())
def test_m2m_marine_mammal(self): # a `my_model` that is attached to a given `marine_mammals` should be accessible by the m2m field name `marine_mammals` marine_mammals = FactoryFloor.MarineMammalFactory() self.instance.marine_mammals.add(marine_mammals) self.assertEqual(self.instance.marine_mammals.count(), 1) self.assertIn(marine_mammals, self.instance.marine_mammals.all())