Exemplo n.º 1
0
 def test_unique_for_jurisdiction(self):
     """Two exemptions may have the same name,
     as long as they belong to different jurisdictions."""
     another_jurisdiction = factories.StateJurisdictionFactory()
     ok_(self.exemption.jurisdiction is not another_jurisdiction)
     factories.ExemptionFactory(jurisdiction=another_jurisdiction)
     response = http_get_response(self.url, self.view, **self.kwargs)
     eq_(response.status_code, 200)
Exemplo n.º 2
0
 def test_state_exemptions(self):
     """An exemption at the state level should return 200."""
     state = factories.StateJurisdictionFactory()
     exemption = factories.ExemptionFactory(jurisdiction=state)
     url = exemption.get_absolute_url()
     kwargs = exemption.jurisdiction.get_slugs()
     kwargs.update({'slug': exemption.slug, 'pk': exemption.pk})
     response = http_get_response(url, self.view, **kwargs)
     eq_(response.status_code, 200)
Exemplo n.º 3
0
    def test_unique_for_jurisdiction(self):
        """Two exemptions may have the same name,
        as long as they belong to different jurisdictions."""
        exemption = factories.ExemptionFactory()
        url = exemption.get_absolute_url()
        kwargs = exemption.jurisdiction.get_slugs()
        kwargs.update({"slug": exemption.slug, "pk": exemption.pk})

        another_jurisdiction = factories.StateJurisdictionFactory(
            parent=exemption.jurisdiction.parent)
        assert_is_not(exemption.jurisdiction, another_jurisdiction)
        factories.ExemptionFactory(jurisdiction=another_jurisdiction)
        response = http_get_response(url, self.view, **kwargs)
        eq_(response.status_code, 200)
Exemplo n.º 4
0
 def setUp(self):
     """Set up tests"""
     self.federal = factories.FederalJurisdictionFactory()
     self.state = factories.StateJurisdictionFactory(parent=self.federal)
     self.local = factories.LocalJurisdictionFactory(parent=self.state)