Skip to content

Commit

Permalink
Compatibility with core#2584 (SampleType to DX) (#63)
Browse files Browse the repository at this point in the history
* Compatibility with core#2584 (SampleType to DX)

* Changelog

* Fix doctests

* Doctest
  • Loading branch information
xispa authored Aug 4, 2024
1 parent b10219f commit a97139a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
2.6.0 (unreleased)
------------------

- #63 Compatibility with senaite.core#2584 (SampleType to DX)
- #61 Compatibility with senaite.core#2567 (AnalysisCategory to DX)
- #61 Compatibility with senaite.core#2471 (Department to DX)

Expand Down
2 changes: 1 addition & 1 deletion docs/crud.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Body Content type (application/json):
"hours": 0,
"minutes": 0
},
"parent_path": "/senaite/bika_setup/bika_sampletypes"
"parent_path": "/senaite/setup/sampletypes"
}
Expand Down
8 changes: 4 additions & 4 deletions src/senaite/jsonapi/tests/doctests/create.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ System will fail with a 400 error when trying to create an object without a
required attribute:

>>> data = {"portal_type": "SampleType",
... "parent_path": api.get_path(setup.bika_sampletypes),
... "parent_path": api.get_path(portal.setup.sampletypes),
... "MinimumVolume": "20 ml",
... "title": "Fresh Egg",
... "Prefix": "FE"}
Expand Down Expand Up @@ -177,7 +177,7 @@ Create a Sample Type
~~~~~~~~~~~~~~~~~~~~

>>> data = {"portal_type": "SampleType",
... "parent_path": api.get_path(setup.bika_sampletypes),
... "parent_path": api.get_path(portal.setup.sampletypes),
... "title": "Fresh Egg",
... "MinimumVolume": "10 gr",
... "AdmittedStickerTemplates": [{"admitted": ["QR_1x14mmx39mm.pt"], "small_default": ["QR_1x14mmx39mm.pt"], "large_default": ["QR_1x14mmx39mm.pt"]}],
Expand All @@ -188,7 +188,7 @@ Create a Sample Type
>>> sample_type.getPrefix()
'FE'
>>> api.get_parent(sample_type)
<SampleTypes at /plone/bika_setup/bika_sampletypes>
<SampleTypes at /plone/setup/sampletypes>


Create a Laboratory Contact
Expand Down Expand Up @@ -300,7 +300,7 @@ instead of the plone's default creation.
['Ecoli', 'Sal']

>>> sample.getSampleType()
<SampleType at /plone/bika_setup/bika_sampletypes/sampletype-2>
<SampleType at /plone/setup/sampletypes/sampletype-2>

>>> sample.getClient()
<Client at /plone/clients/client-7>
Expand Down
4 changes: 2 additions & 2 deletions src/senaite/jsonapi/tests/doctests/search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Functional Helpers:
... api.create(portal.clients, "Client", title="Happy Hills", ClientID="HH")
... api.create(portal.clients, "Client", title="ACME", ClientID="AC")
... api.create(portal.clients, "Client", title="Fill the gap", ClientID="FG")
... api.create(setup.bika_sampletypes, "SampleType", title="Water", Prefix="W")
... api.create(setup.bika_sampletypes, "SampleType", title="Dust", Prefix="D")
... api.create(portal.setup.sampletypes, "SampleType", title="Water", Prefix="W")
... api.create(portal.setup.sampletypes, "SampleType", title="Dust", Prefix="D")
... transaction.commit()

Variables:
Expand Down

0 comments on commit a97139a

Please sign in to comment.