Ejemplo n.º 1
0
 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())
Ejemplo n.º 2
0
 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())
Ejemplo n.º 3
0
 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())
Ejemplo n.º 4
0
    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
Ejemplo n.º 5
0
    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,))
Ejemplo n.º 6
0
 def setUp(self):
     super().setUp()
     self.instance = FactoryFloor.RegionFactory()
Ejemplo n.º 7
0
 def test_is_instance(self):
     instance = FactoryFloor.BranchFactory()
     self.assert_inheritance(type(self.instance), shared_models.SimpleLookupWithUUID)
Ejemplo n.º 8
0
 def setUp(self):
     super().setUp()
     self.instance = FactoryFloor.BranchFactory()