Skip to content

Commit

Permalink
Merge pull request #293 from kukirokuk/a619013536811630_add_060_schema
Browse files Browse the repository at this point in the history
Add test data for shema 06
  • Loading branch information
leits committed Apr 20, 2018
2 parents 38e4388 + 44dd5f6 commit e38ad58
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/openprocurement/api/tests/blanks/json_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@
u"fuelType": ["petrol"]
}
}

schema_properties_060 = {
u"code": "06000000-2",
u"version": "latest",
"properties": {
u"area": 1.2,
u"cadastralNumber": "1234567890:12:123:1234",
u"inUse": True
}
}

test_item_data_with_schema = deepcopy(test_item_data)
test_item_data_with_schema['classification']['id'] = schema_properties['code']
test_item_data_with_schema['schema_properties'] = schema_properties
Expand All @@ -84,6 +95,10 @@
test_item_data_with_schema_341['classification']['id'] = schema_properties_341['code']
test_item_data_with_schema_341['schema_properties'] = schema_properties_341

test_item_data_with_schema_060 = deepcopy(test_item_data)
test_item_data_with_schema_060['classification']['id'] = schema_properties_060['code']
test_item_data_with_schema_060['schema_properties'] = schema_properties_060

test_asset_basic_data = {
"title": u"Земля для космодрому",
"assetType": "basic",
Expand Down Expand Up @@ -119,6 +134,10 @@
test_asset_basic_data_with_schema_341['classification']['id'] = schema_properties_341['code']
test_asset_basic_data_with_schema_341['schema_properties'] = schema_properties_341

test_asset_basic_data_with_schema_060 = deepcopy(test_asset_basic_data)
test_asset_basic_data_with_schema_060['classification']['id'] = schema_properties_060['code']
test_asset_basic_data_with_schema_060['schema_properties'] = schema_properties_060

test_debt_data = {
"agreementNumber": u"42",
"debtorType": u"legalPerson",
Expand All @@ -141,6 +160,10 @@
test_asset_compound_data_341['assetType'] = 'compound'
test_asset_compound_data_341['items'] = [test_item_data_with_schema_341, test_item_data_with_schema_341]

test_asset_compound_data_060 = deepcopy(test_asset_basic_data)
test_asset_compound_data_060['assetType'] = 'compound'
test_asset_compound_data_060['items'] = [test_item_data_with_schema_060, test_item_data_with_schema_060]

test_asset_claimrights_data = deepcopy(test_asset_compound_data)
test_asset_claimrights_data['assetType'] = 'claimRights'
test_asset_claimrights_data['debt'] = test_debt_data
Expand Down
2 changes: 1 addition & 1 deletion src/openprocurement/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def set_ownership(item, request):
if not item.get('owner'):
item.owner = request.authenticated_userid
owner_token = generate_id()
item.owner_token = owner_token #sha512(owner_token).hexdigest()
item.owner_token = owner_token # sha512(owner_token).hexdigest()
acc = {'token': owner_token}
if isinstance(getattr(type(item), 'transfer_token', None), StringType):
transfer_token = generate_id()
Expand Down

0 comments on commit e38ad58

Please sign in to comment.