def test_left_and_right_project_ids(self): with pytest.raises(exceptions.ProjectRelationshipError): project1 = ProjectFactory() project2 = ProjectFactory() PartyRelationshipFactory.create( party1__project=project1, party2__project=project2 )
def test_project_relationship_invalid(self): with pytest.raises(exceptions.ProjectRelationshipError): project = ProjectFactory() TenureRelationshipFactory.create( party__project=project, spatial_unit__project=project )
def test_project_relationship_invalid(self): with pytest.raises(exceptions.ProjectRelationshipError): project = ProjectFactory() SpatialRelationshipFactory( su1__project=project, su2__project=project )
def test_str(self): project = ProjectFactory(name='TestProject') relationship = PartyRelationshipFactory( project=project, party1__project=project, party1__name='Simba', party2__project=project, party2__name='Mufasa', type='C') assert str(relationship) == ( "<PartyRelationship: <Simba> is-child-of <Mufasa>>") assert repr(relationship) == ( "<PartyRelationship: <Simba> is-child-of <Mufasa>>")
def test_str(self): project = ProjectFactory(name='TestProject') tenure_type = TenureRelationshipType(id='LS', label="Leasehold") relationship = TenureRelationshipFactory( project=project, party__project=project, party__name='Family', spatial_unit__project=project, spatial_unit__type='PA', tenure_type=tenure_type) assert str(relationship) == ( "<TenureRelationship: <Family> Leasehold <Parcel>>") assert repr(relationship) == ( "<TenureRelationship: <Family> Leasehold <Parcel>>")
def test_left_and_right_project_ids(self): with pytest.raises(exceptions.ProjectRelationshipError): project = ProjectFactory() TenureRelationshipFactory.create(party__project=project)
def test_project_relationship_invalid(self): with pytest.raises(exceptions.ProjectRelationshipError): project = ProjectFactory() PartyRelationshipFactory.create(party1__project=project)
def test_left_and_right_project_ids(self): with pytest.raises(exceptions.ProjectRelationshipError): project = ProjectFactory() SpatialRelationshipFactory(su1__project=project)
def setUp(self): super().setUp() self.project = ProjectFactory(name='TestProject')