equal
deleted
inserted
replaced
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """unit tests for cubicweb.web.application""" |
18 """unit tests for cubicweb.web.application""" |
19 |
19 |
20 import base64 |
20 import base64 |
21 |
21 |
|
22 from six import text_type |
22 from six.moves import http_client |
23 from six.moves import http_client |
23 from six.moves.http_cookies import SimpleCookie |
24 from six.moves.http_cookies import SimpleCookie |
24 |
25 |
25 from logilab.common.testlib import TestCase, unittest_main |
26 from logilab.common.testlib import TestCase, unittest_main |
26 from logilab.common.decorators import clear_cache, classproperty |
27 from logilab.common.decorators import clear_cache, classproperty |
180 cnx.commit() |
181 cnx.commit() |
181 |
182 |
182 def test_publish_validation_error(self): |
183 def test_publish_validation_error(self): |
183 with self.admin_access.web_request() as req: |
184 with self.admin_access.web_request() as req: |
184 user = self.user(req) |
185 user = self.user(req) |
185 eid = unicode(user.eid) |
186 eid = text_type(user.eid) |
186 req.form = { |
187 req.form = { |
187 'eid': eid, |
188 'eid': eid, |
188 '__type:'+eid: 'CWUser', '_cw_entity_fields:'+eid: 'login-subject', |
189 '__type:'+eid: 'CWUser', '_cw_entity_fields:'+eid: 'login-subject', |
189 'login-subject:'+eid: '', # ERROR: no login specified |
190 'login-subject:'+eid: '', # ERROR: no login specified |
190 # just a sample, missing some necessary information for real life |
191 # just a sample, missing some necessary information for real life |