def test_related(self): # a `branch` that is attached to a given `region` should be accessible by the reverse name `branches` region = FactoryFloor.RegionFactory() my_instance = self.instance my_instance.region = region my_instance.save() self.assertIn(my_instance, region.branches.all())
def test_related(self): # a `division` that is attached to a given `branch` should be accessible by the reverse name `divisions` branch = FactoryFloor.BranchFactory() my_instance = self.instance my_instance.branch = branch my_instance.save() self.assertIn(my_instance, branch.divisions.all())
def test_related(self): # a division associated with a section should be accessible by the reverse name called `division` division = FactoryFloor.DivisionFactory() my_instance = self.instance my_instance.division = division my_instance.save() self.assertIn(my_instance, division.sections.all())
def createDict(self): if self._details_dict: return self._details_dict self._details_dict = {} obj = SharedFactory.CruiseFactory() self._details_dict['cru_1'] = obj return self._details_dict
def setUp(self): super().setUp() self.data = SharedFactory.CruiseFactory.get_valid_data() obj = SharedFactory.CruiseFactory() self.test_url = reverse_lazy('whalesdb:update_cru', args=(obj.pk,)) # Since this is intended to be used as a pop-out form, the html file should start with an underscore self.test_expected_template = 'shared_models/shared_entry_form.html' self.expected_view = views.CruUpdate self.expected_form = forms.CruForm self.expected_success_url = reverse_lazy("whalesdb:details_cru", args=(obj.pk,))
def setUp(self): super().setUp() self.instance = FactoryFloor.RegionFactory()
def test_is_instance(self): instance = FactoryFloor.BranchFactory() self.assert_inheritance(type(self.instance), shared_models.SimpleLookupWithUUID)
def setUp(self): super().setUp() self.instance = FactoryFloor.BranchFactory()