Skip to content

Commit

Permalink
Merge pull request #4839 from open-formulieren/feature/4796-extending…
Browse files Browse the repository at this point in the history
…-fetch-products-test

✅ [#4796] Added mock rx mission service to tests
  • Loading branch information
sergei-maertens authored Nov 20, 2024
2 parents 2c83208 + 8bbd6e8 commit 7381c5b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,36 @@ interactions:
status:
code: 200
message: OK
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate, br
Connection:
- keep-alive
User-Agent:
- python-requests/2.32.2
method: GET
uri: http://localhost/product/1234abcd-12ab-34cd-56ef-12345abcde10
response:
body:
string: "{\n \"code\": \"RX-10\",\n \"description\": \"Advies vergunning met
instemming\",\n \"id\": \"1234abcd-12ab-34cd-56ef-12345abcde10\",\n \"streeftermijn\":
\"P0D\",\n \"uiterlijkeTermijn\": \"P0D\",\n \"url\": \"https://example.com/product/1234abcd-12ab-34cd-56ef-12345abcde10\"\n}\n"
headers:
Connection:
- close
Content-Length:
- '256'
Content-Type:
- application/json
Date:
- Wed, 20 Nov 2024 18:23:37 GMT
Server:
- Werkzeug/3.1.3 Python/3.12.7
status:
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ class GetProductsListViewTests(OFVCRMixin, APITestCase):
def setUpTestData(cls):
super().setUpTestData()

# create service for the docker-compose rx-mission instance.
ServiceFactory.create(
api_type=APITypes.orc,
api_root="http://localhost/product",
auth_type=AuthTypes.no_auth,
)
cls.zgw_api_group = ZGWApiGroupConfigFactory.create(
for_test_docker_compose=True
)
Expand Down Expand Up @@ -342,7 +348,7 @@ def test_fetch_products_by_case_type(self):
expected_products = [
{
"url": "http://localhost/product/1234abcd-12ab-34cd-56ef-12345abcde10",
"description": "",
"description": "Advies vergunning met instemming",
}
]
self.assertEqual(results, expected_products)

0 comments on commit 7381c5b

Please sign in to comment.