Commit ae0afc93 authored by Pavel Kuzmenko's avatar Pavel Kuzmenko
Browse files

Merge branch 'alesh/43/fix-tests' into 'master'

fix(tests): fix integration tests due to mirror update

See merge request !25
parents f630de97 798dc379
Pipeline #29639 passed with stages
in 9 minutes and 37 seconds
...@@ -77,7 +77,7 @@ class WebSocketActionTest(test_utils.AioHTTPTestCase): ...@@ -77,7 +77,7 @@ class WebSocketActionTest(test_utils.AioHTTPTestCase):
self.assertEqual(client_obj['actingEntity']['contactPoint']['name']['uk_UA'], 'updated_value') self.assertEqual(client_obj['actingEntity']['contactPoint']['name']['uk_UA'], 'updated_value')
@test_utils.unittest_run_loop @test_utils.unittest_run_loop
async def test_update_with_none(self): async def test_update_with_invalid_value(self):
document = deepcopy(ACTION_OBJECT) document = deepcopy(ACTION_OBJECT)
document = _migrate(document, 'action') document = _migrate(document, 'action')
document = load_action_object(document).to_native() document = load_action_object(document).to_native()
...@@ -91,7 +91,9 @@ class WebSocketActionTest(test_utils.AioHTTPTestCase): ...@@ -91,7 +91,9 @@ class WebSocketActionTest(test_utils.AioHTTPTestCase):
{'$set': {'actingEntity.contactPoint.name.uk_UA': None}}) {'$set': {'actingEntity.contactPoint.name.uk_UA': None}})
await asyncio.sleep(2) await asyncio.sleep(2)
client_obj = await self.db_copy.action.find_one({"_id": result.inserted_id}) client_obj = await self.db_copy.action.find_one({"_id": result.inserted_id})
self.assertEqual(client_obj['actingEntity']['contactPoint']['name']['uk_UA'], None)
# Should not be updated because the value changes to invalid
self.assertEqual(client_obj['actingEntity']['contactPoint']['name']['uk_UA'], 'magna commodo officia')
@test_utils.unittest_run_loop @test_utils.unittest_run_loop
async def test_replace(self): async def test_replace(self):
......
...@@ -77,7 +77,7 @@ class WebSocketLeaseTest(test_utils.AioHTTPTestCase): ...@@ -77,7 +77,7 @@ class WebSocketLeaseTest(test_utils.AioHTTPTestCase):
self.assertEqual(client_obj['sellingEntity']['contactPoint']['name']['uk_UA'], 'updated_value') self.assertEqual(client_obj['sellingEntity']['contactPoint']['name']['uk_UA'], 'updated_value')
@test_utils.unittest_run_loop @test_utils.unittest_run_loop
async def test_update_with_none(self): async def test_update_with_invalid_value(self):
document = deepcopy(LEASE_OBJECT) document = deepcopy(LEASE_OBJECT)
document = _migrate(document, 'lease_request') document = _migrate(document, 'lease_request')
document = load_lease_request_object(document).to_native() document = load_lease_request_object(document).to_native()
...@@ -91,7 +91,9 @@ class WebSocketLeaseTest(test_utils.AioHTTPTestCase): ...@@ -91,7 +91,9 @@ class WebSocketLeaseTest(test_utils.AioHTTPTestCase):
{'$set': {'sellingEntity.contactPoint.name.uk_UA': None}}) {'$set': {'sellingEntity.contactPoint.name.uk_UA': None}})
await asyncio.sleep(2) await asyncio.sleep(2)
client_obj = await self.db_copy.lease_request.find_one({"_id": result.inserted_id}) client_obj = await self.db_copy.lease_request.find_one({"_id": result.inserted_id})
self.assertEqual(client_obj['sellingEntity']['contactPoint']['name']['uk_UA'], None)
# Should not be updated because the value changes to invalid
self.assertEqual(client_obj['sellingEntity']['contactPoint']['name']['uk_UA'], 'magna commodo officia')
@test_utils.unittest_run_loop @test_utils.unittest_run_loop
async def test_replace(self): async def test_replace(self):
......
...@@ -77,7 +77,7 @@ class WebSocketRegiatryTest(test_utils.AioHTTPTestCase): ...@@ -77,7 +77,7 @@ class WebSocketRegiatryTest(test_utils.AioHTTPTestCase):
self.assertEqual(client_obj['relatedOrganizations']['propertyOwner']['representativeInfo'], 'updated_value') self.assertEqual(client_obj['relatedOrganizations']['propertyOwner']['representativeInfo'], 'updated_value')
@test_utils.unittest_run_loop @test_utils.unittest_run_loop
async def test_update_with_none(self): async def test_update_with_invalid_value(self):
document = deepcopy(REGISTRY_OBJECT) document = deepcopy(REGISTRY_OBJECT)
document = _migrate(document, 'registry') document = _migrate(document, 'registry')
document = load_registry_object(document).to_native() document = load_registry_object(document).to_native()
...@@ -91,7 +91,9 @@ class WebSocketRegiatryTest(test_utils.AioHTTPTestCase): ...@@ -91,7 +91,9 @@ class WebSocketRegiatryTest(test_utils.AioHTTPTestCase):
{'$set': {'relatedOrganizations.propertyOwner.representativeInfo': None}}) {'$set': {'relatedOrganizations.propertyOwner.representativeInfo': None}})
await asyncio.sleep(2) await asyncio.sleep(2)
client_obj = await self.db_copy.registry.find_one({"_id": result.inserted_id}) client_obj = await self.db_copy.registry.find_one({"_id": result.inserted_id})
self.assertEqual(client_obj['relatedOrganizations']['propertyOwner']['representativeInfo'], None)
# Should not be updated because the value changes to invalid
self.assertEqual(client_obj['relatedOrganizations']['propertyOwner']['representativeInfo'], 'Довіреність')
@test_utils.unittest_run_loop @test_utils.unittest_run_loop
async def test_replace(self): async def test_replace(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment