Skip to content

Commit

Permalink
Update permission imports (#47)
Browse files Browse the repository at this point in the history
* Update permissions import

* Changelog updated

* Fixed tests

* Better changelog
  • Loading branch information
ramonski authored Oct 18, 2024
1 parent 759eb11 commit 0d7d413
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
2.6.0 (unreleased)
------------------

- #47 Update permission imports
- #46 Compatibility with core#2584 (SampleType to DX)
- #44 Compatibility with core#2567 (AnalysisCategory to DX)
- #42 Compatibility with core#2471 (Department to DX)
Expand Down
2 changes: 1 addition & 1 deletion src/senaite/storage/setuphandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

from Acquisition import aq_base
from bika.lims import api
from bika.lims import permissions
from plone import api as ploneapi
from Products.CMFCore.permissions import ModifyPortalContent
from Products.CMFPlone.utils import _createObjectByType
from Products.DCWorkflow.Guard import Guard
from senaite.core import permissions
from senaite.core.catalog import SAMPLE_CATALOG
from senaite.core.setuphandlers import setup_catalog_mappings
from senaite.core.setuphandlers import setup_core_catalogs
Expand Down
15 changes: 8 additions & 7 deletions src/senaite/storage/tests/doctests/PrimarySample.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Variables:

>>> portal = self.portal
>>> request = self.request
>>> setup = api.get_setup()
>>> setup = api.get_senaite_setup()
>>> bika_setup = api.get_bika_setup()
>>> storage = portal.senaite_storage

Assign default roles for the user to test with:
Expand All @@ -60,12 +61,12 @@ Create some baseline objects for the test:
>>> client = api.create(portal.clients, "Client", Name="Happy Hills", ClientID="HH", MemberDiscountApplies=True)
>>> contact = api.create(client, "Contact", Firstname="Rita", Lastname="Mohale")
>>> sampletype = api.create(setup.sampletypes, "SampleType", title="Water", Prefix="W")
>>> labcontact = api.create(setup.bika_labcontacts, "LabContact", Firstname="Lab", Lastname="Manager")
>>> department = api.create(portal.setup.departments, "Department", title="Chemistry", Manager=labcontact)
>>> category = api.create(portal.setup.analysiscategories, "AnalysisCategory", title="Metals", Department=department)
>>> Cu = api.create(setup.bika_analysisservices, "AnalysisService", title="Copper", Keyword="Cu", Price="15", Category=category.UID(), Accredited=True)
>>> Fe = api.create(setup.bika_analysisservices, "AnalysisService", title="Iron", Keyword="Fe", Price="10", Category=category.UID())
>>> Au = api.create(setup.bika_analysisservices, "AnalysisService", title="Gold", Keyword="Au", Price="20", Category=category.UID())
>>> labcontact = api.create(bika_setup.bika_labcontacts, "LabContact", Firstname="Lab", Lastname="Manager")
>>> department = api.create(setup.departments, "Department", title="Chemistry", Manager=labcontact)
>>> category = api.create(setup.analysiscategories, "AnalysisCategory", title="Metals", Department=department)
>>> Cu = api.create(bika_setup.bika_analysisservices, "AnalysisService", title="Copper", Keyword="Cu", Price="15", Category=category.UID(), Accredited=True)
>>> Fe = api.create(bika_setup.bika_analysisservices, "AnalysisService", title="Iron", Keyword="Fe", Price="10", Category=category.UID())
>>> Au = api.create(bika_setup.bika_analysisservices, "AnalysisService", title="Gold", Keyword="Au", Price="20", Category=category.UID())

Auto-transition primary sample
..............................
Expand Down

0 comments on commit 0d7d413

Please sign in to comment.