-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds dexterity types and basic tests
- Loading branch information
Showing
9 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .map import Map | ||
from .source import Source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from plone.dexterity.content import Container | ||
|
||
|
||
class Map(Container): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from plone.dexterity.content import Container | ||
|
||
|
||
class Source(Container): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<object name="portal_types"> | ||
<object name="seantis.placemap.map" meta_type="Dexterity FTI" /> | ||
<object name="seantis.placemap.source" meta_type="Dexterity FTI" /> | ||
</object> |
29 changes: 29 additions & 0 deletions
29
seantis/placemap/profiles/default/types/seantis.placemap.map.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0"?> | ||
<object name="seantis.placemap.list" meta_type="Dexterity FTI" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
i18n:domain="seantis.placemap"> | ||
|
||
<!-- Basic metadata --> | ||
<property name="title" i18n:translate="">Placemap</property> | ||
<property name="icon_expr">string:${portal_url}/folder_icon.png</property> | ||
<property name="global_allow">True</property> | ||
<property name="filter_content_types">False</property> | ||
<property name="allowed_content_types"> | ||
<element value="seantis.placemap.source" /> | ||
</property> | ||
|
||
<!-- schema interface --> | ||
<property name="schema">seantis.placemap.interfaces.IMap</property> | ||
|
||
<!-- class used for content items --> | ||
<property name="klass">seantis.placemap.content.Map</property> | ||
|
||
<!-- add permission --> | ||
<property name="add_permission">cmf.AddPortalContent</property> | ||
|
||
<!-- enabled behaviors --> | ||
<property name="behaviors"> | ||
<element value="plone.app.content.interfaces.INameFromTitle" /> | ||
</property> | ||
|
||
</object> |
29 changes: 29 additions & 0 deletions
29
seantis/placemap/profiles/default/types/seantis.placemap.source.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0"?> | ||
<object name="seantis.placemap.list" meta_type="Dexterity FTI" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
i18n:domain="seantis.placemap"> | ||
|
||
<!-- Basic metadata --> | ||
<property name="title" i18n:translate="">Placemap Source</property> | ||
<property name="icon_expr">string:${portal_url}/file_icon.png</property> | ||
<property name="global_allow">True</property> | ||
<property name="filter_content_types">False</property> | ||
<property name="allowed_content_types"> | ||
<element value="seantis.placemap.source" /> | ||
</property> | ||
|
||
<!-- schema interface --> | ||
<property name="schema">seantis.placemap.interfaces.ISource</property> | ||
|
||
<!-- class used for content items --> | ||
<property name="klass">seantis.placemap.content.Source</property> | ||
|
||
<!-- add permission --> | ||
<property name="add_permission">cmf.AddPortalContent</property> | ||
|
||
<!-- enabled behaviors --> | ||
<property name="behaviors"> | ||
<element value="plone.app.content.interfaces.INameFromTitle" /> | ||
</property> | ||
|
||
</object> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from seantis.placemap import tests | ||
from seantis.placemap import content | ||
|
||
|
||
class TestTypes(tests.IntegrationTestCase): | ||
|
||
def test_create_types(self): | ||
map = self.create_map() | ||
self.assertIs(type(map.aq_base), content.Map) | ||
|
||
source = self.create_source(map) | ||
self.assertIs(type(source.aq_base), content.Source) |