def test_str(self): project = ProjectFactory.build(name='TestProject') relationship = TenureRelationshipFactory.build( project=project, party__project=project, party__name='Family', spatial_unit__project=project, spatial_unit__type='PA', tenure_type='LS') assert str(relationship) == ( "<TenureRelationship: <Family> LS <Parcel>>")
def test_repr(self): project = ProjectFactory.build(slug='prj') party = PartyFactory.build(id='abc123', project=project) su = SpatialUnitFactory.build(id='def456', project=project) relationship = TenureRelationshipFactory.build(id='abc123', project=project, party=party, spatial_unit=su, tenure_type='CR') assert repr(relationship) == ('<TenureRelationship id=abc123' ' party=abc123 spatial_unit=def456' ' project=prj tenure_type=CR>')
def test_str(self): project = ProjectFactory.build(name='TestProject') tenure_type = TenureRelationshipType(id='LS', label="Leasehold") relationship = TenureRelationshipFactory.build( 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>>")
def test_repr(self): project = ProjectFactory.build(slug='prj') party = PartyFactory.build(id='abc123', project=project) su = SpatialUnitFactory.build(id='def456', project=project) relationship = TenureRelationshipFactory.build( id='abc123', project=project, party=party, spatial_unit=su, tenure_type=TenureRelationshipType(id='CR')) assert repr(relationship) == ('<TenureRelationship id=abc123' ' party=abc123 spatial_unit=def456' ' project=prj tenure_type=CR>')