From 202d26fc9f1df12c488829d43b483dd832735ec8 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Wed, 5 Oct 2016 15:28:45 +0200 Subject: [PATCH] Avoid overriding built in copyright --- tests/test_api.py | 8 ++++---- web/views/manifestations.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 171f770..05b6510 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -48,16 +48,16 @@ def test_create_manifestation(client, user): data=json.dumps(payload), headers={'Content-Type': 'application/json'}) resp_dict = resp.json - copyright = resp_dict['copyright'] + copyright_ = resp_dict['copyright'] manifestation = resp_dict['manifestation'] work = resp_dict['work'] - assert bool(copyright['rightsOf']) is True + assert bool(copyright_['rightsOf']) is True assert bool(manifestation['manifestationOfWork']) is True # Check @ids - assert copyright['@id'].startswith('../right/') - assert bool(copyright['@id'].strip('../right/')) is True + assert copyright_['@id'].startswith('../right/') + assert bool(copyright_['@id'].strip('../right/')) is True assert bool(manifestation['@id']) is True assert work['@id'].startswith('../work/') assert bool(work['@id'].strip('../work/')) is True diff --git a/web/views/manifestations.py b/web/views/manifestations.py index a320d3a..27e28eb 100644 --- a/web/views/manifestations.py +++ b/web/views/manifestations.py @@ -31,7 +31,7 @@ def post(self): copyright_holder['verifying_key'] = copyright_holder.pop('verifyingKey') copyright_holder['signing_key'] = copyright_holder.pop('signingKey') - copyright, manifestation, work = coalaip.register_manifestation( + copyright_, manifestation, work = coalaip.register_manifestation( manifestation_data=manifestation, copyright_holder=copyright_holder, work_data=work) @@ -39,7 +39,7 @@ def post(self): # Add the appropraite @id to the JSON-LD res = {} for (entity, id_template, key) in [ - (copyright, '../right/{}', 'copyright'), + (copyright_, '../right/{}', 'copyright'), (manifestation, '{}', 'manifestation'), (work, '../work/{}', 'work')]: ld_data = entity.to_jsonld()