|
| 1 | +from Acquisition import aq_parent |
| 2 | +from collections.abc import Generator |
1 | 3 | from plone.dexterity.fti import DexterityFTI |
| 4 | +from Products.CMFPlone.Portal import PloneSite |
2 | 5 |
|
3 | 6 | import pytest |
4 | 7 |
|
5 | 8 |
|
6 | | -@pytest.mark.skip(reason="Only available if plone.app.multilingual is installed") |
| 9 | +@pytest.fixture(scope="session") |
| 10 | +def answers() -> dict: |
| 11 | + return { |
| 12 | + "site_id": "plone2", |
| 13 | + "title": "Test Site", |
| 14 | + "description": "Testing site.", |
| 15 | + "available_languages": ["de", "en"], |
| 16 | + "default_language": "de", |
| 17 | + "portal_timezone": "UTC", |
| 18 | + "setup_content": False, |
| 19 | + } |
| 20 | + |
| 21 | + |
| 22 | +@pytest.fixture(scope="class") |
| 23 | +def portal(portal_class, create_site, answers) -> Generator[PloneSite, None, None]: |
| 24 | + app = aq_parent(portal_class) |
| 25 | + site = create_site(app=app, answers=answers) |
| 26 | + yield site |
| 27 | + |
| 28 | + |
7 | 29 | class TestContentTypeFTI: |
8 | 30 | portal_type: str = "LRF" |
9 | 31 |
|
10 | 32 | @pytest.fixture(autouse=True) |
11 | | - def _setup(self, portal, get_fti): |
| 33 | + def _setup(self, portal, get_fti) -> None: |
12 | 34 | self.portal = portal |
13 | 35 | self.fti: DexterityFTI = get_fti(self.portal_type) |
14 | 36 |
|
15 | 37 | @pytest.mark.parametrize( |
16 | 38 | "attr,expected", |
17 | 39 | [ |
18 | | - ("title", "LRF"), |
| 40 | + ("title", "Language Root Folder"), |
19 | 41 | ("global_allow", False), |
20 | 42 | ], |
21 | 43 | ) |
|
0 commit comments