Skip to content

Commit

Permalink
Finalize initial set of Tenure Relationship Records tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Alvin Villar committed Feb 10, 2018
1 parent 9ed3cbc commit 8789249
Show file tree
Hide file tree
Showing 14 changed files with 4,362 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cadasta/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.4.0'
__version__ = '0.5.0'
2 changes: 2 additions & 0 deletions cadasta/test/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def update_form_field(self, field_name, field_value):
Select(field).select_by_value(field_value)
else: # Assume tag_name is 'input' with type 'text' or 'password'
field.clear()
if not isinstance(field_value, str):
field_value = str(field_value)
field.send_keys(field_value)

def assert_form_field_has_error(self, field_name, error_msg):
Expand Down
91 changes: 88 additions & 3 deletions cadasta/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,24 @@ def conditional_attrs_prj(all_fixtures):
if 'functest-conditional-attrs-prj-' in prj['slug'])


@pytest.fixture(scope='session')
def custom_party_attrs_prj(all_fixtures):
return next(prj for prj in all_fixtures['organization.project']
if 'functest-custom-party-attrs-prj-' in prj['slug'])


@pytest.fixture(scope='session')
def custom_tenure_attrs_prj(all_fixtures):
return next(prj for prj in all_fixtures['organization.project']
if 'functest-custom-tenure-attrs-prj-' in prj['slug'])


@pytest.fixture(scope='session')
def custom_conditional_attrs_prj(all_fixtures):
return next(prj for prj in all_fixtures['organization.project']
if 'functest-custom-conditional-attrs-prj-' in prj['slug'])


@pytest.fixture(scope='session')
def another_prj(all_fixtures):
return next(prj for prj in all_fixtures['organization.project']
Expand All @@ -156,16 +174,83 @@ def all_org_members(all_fixtures, basic_org):
return members


# Under FuncTest Records Prj
@pytest.fixture(scope='session')
def basic_parcel(all_fixtures):
loc = next(location for location in all_fixtures['spatial.spatialunit']
if 'xqzcnvuy7u9gywqkp2xa3rbn' == location['pk'])
loc['type_label'] = 'Parcel'
return loc


# Under FuncTest Custom Attrs Prj
@pytest.fixture(scope='session')
def custom_building(all_fixtures):
loc = next(location for location in all_fixtures['spatial.spatialunit']
if 'tcqrxxaep8jcf83xnynh6pxi' == location['pk'])
loc['type_label'] = 'Building'
return loc


# Under FuncTest Conditional Attrs Prj
@pytest.fixture(scope='session')
def basic_apartment(all_fixtures):
loc = next(location for location in all_fixtures['spatial.spatialunit']
if 'szcmfx455yt3r3q43thxk2mr' == location['pk'])
loc['type_label'] = 'Apartment'
return loc


# Under FuncTest Custom Party Attrs Prj
@pytest.fixture(scope='session')
def basic_rightofway(all_fixtures):
loc = next(location for location in all_fixtures['spatial.spatialunit']
if 'wdxgeavx3q95vmtr8xkyu2ac' == location['pk'])
loc['type_label'] = 'Right-of-way'
return loc


# Under FuncTest Custom Tenure Attrs Prj
@pytest.fixture(scope='session')
def basic_national_park(all_fixtures):
loc = next(location for location in all_fixtures['spatial.spatialunit']
if 'sq8nvq4syhy7zdf4tsrwia54' == location['pk'])
loc['type_label'] = 'National Park Boundary'
return loc


# Under FuncTest Custom-Conditional Attrs Prj
@pytest.fixture(scope='session')
def basic_community_boundary(all_fixtures):
loc = next(location for location in all_fixtures['spatial.spatialunit']
if 'zw27euyqjmvnvxfedh4s7qae' == location['pk'])
loc['type_label'] = 'Community Boundary'
return loc


# Under FuncTest Records Prj
@pytest.fixture(scope='session')
def basic_individual(all_fixtures):
return next(party for party in all_fixtures['party.party']
if 'Basic Individual' == party['name'])


# Under FuncTest Custom Tenure Attrs Prj
@pytest.fixture(scope='session')
def basic_parcel(all_fixtures):
return next(location for location in all_fixtures['spatial.spatialunit']
if 'xqzcnvuy7u9gywqkp2xa3rbn' == location['pk'])
def basic_group(all_fixtures):
return next(party for party in all_fixtures['party.party']
if 'Basic Group' == party['name'])


# Under FuncTest Records Prj
@pytest.fixture(scope='session')
def basic_water_rights(all_fixtures, basic_parcel, basic_individual):
tenure_rel = next(rel for rel in all_fixtures['party.tenurerelationship']
if 'yku4hjxu5rka882n84jyw5wj' == rel['pk'])
tenure_rel['location'] = basic_parcel
tenure_rel['party'] = basic_individual
tenure_rel['type_label'] = 'Water Rights'
return tenure_rel


@pytest.fixture
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 8789249

Please sign in to comment.