@@ -30,6 +30,11 @@ def setUp(self):
30
30
self .request = self .layer ["request" ]
31
31
self .portal = self .layer ["portal" ]
32
32
setRoles (self .portal , TEST_USER_ID , ["Manager" ])
33
+ self .entity = api .content .create (
34
+ container = self .portal ,
35
+ type = "imio.directory.Entity" ,
36
+ title = "Entity" ,
37
+ )
33
38
34
39
def test_ct_contact_schema (self ):
35
40
fti = queryUtility (IDexterityFTI , name = "imio.directory.Contact" )
@@ -55,7 +60,7 @@ def test_ct_contact_factory(self):
55
60
def test_ct_contact_adding (self ):
56
61
setRoles (self .portal , TEST_USER_ID , ["Contributor" ])
57
62
contact = api .content .create (
58
- container = self .portal ,
63
+ container = self .entity ,
59
64
type = "imio.directory.Contact" ,
60
65
title = "contact" ,
61
66
)
@@ -73,17 +78,15 @@ def test_ct_contact_adding(self):
73
78
api .content .delete (obj = contact )
74
79
self .assertNotIn ("contact" , parent .objectIds ())
75
80
76
- def test_ct_contact_globally_addable (self ):
81
+ def test_ct_contact_not_globally_addable (self ):
77
82
setRoles (self .portal , TEST_USER_ID , ["Contributor" ])
78
83
fti = queryUtility (IDexterityFTI , name = "imio.directory.Contact" )
79
- self .assertTrue (
80
- fti .global_allow , u"{0} is not globally addable!" .format (fti .id )
81
- )
84
+ self .assertFalse (fti .global_allow , u"{0} is globally addable!" .format (fti .id ))
82
85
83
- def test_ct_contact_filter_content_type_true (self ):
86
+ def test_ct_contact_filter_content_type (self ):
84
87
setRoles (self .portal , TEST_USER_ID , ["Contributor" ])
85
88
contact = api .content .create (
86
- container = self .portal ,
89
+ container = self .entity ,
87
90
type = "imio.directory.Contact" ,
88
91
title = "contact" ,
89
92
)
@@ -116,7 +119,7 @@ def test_phone_constraint(self):
116
119
117
120
def test_name_chooser (self ):
118
121
contact = api .content .create (
119
- container = self .portal ,
122
+ container = self .entity ,
120
123
type = "imio.directory.Contact" ,
121
124
title = "contact" ,
122
125
)
@@ -132,7 +135,7 @@ def test_name_chooser(self):
132
135
133
136
def test_gallery_in_contact_view (self ):
134
137
contact = api .content .create (
135
- container = self .portal ,
138
+ container = self .entity ,
136
139
type = "imio.directory.Contact" ,
137
140
title = "contact" ,
138
141
)
@@ -148,7 +151,7 @@ def test_gallery_in_contact_view(self):
148
151
149
152
def test_files_in_contact_view (self ):
150
153
contact = api .content .create (
151
- container = self .portal ,
154
+ container = self .entity ,
152
155
type = "imio.directory.Contact" ,
153
156
title = "contact" ,
154
157
)
0 commit comments