web/test/unittest_views_basecontrollers.py
branchstable
changeset 5389 809d3b5b3d31
parent 5377 84d14ddfae13
child 5408 120db445c179
child 5421 8167de96c523
equal deleted inserted replaced
5388:9167751463d4 5389:809d3b5b3d31
     3 :organization: Logilab
     3 :organization: Logilab
     4 :copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
     4 :copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     7 """
     7 """
     8 try:
       
     9     import json
       
    10 except ImportError:
       
    11     import simplejson as json
       
    12 
     8 
    13 from logilab.common.testlib import unittest_main, mock_object
     9 from logilab.common.testlib import unittest_main, mock_object
    14 
    10 
    15 from cubicweb import Binary, NoSelectableObject, ValidationError
    11 from cubicweb import Binary, NoSelectableObject, ValidationError
    16 from cubicweb.view import STRICT_DOCTYPE
    12 from cubicweb.view import STRICT_DOCTYPE
    17 from cubicweb.devtools.testlib import CubicWebTC
    13 from cubicweb.devtools.testlib import CubicWebTC
    18 from cubicweb.uilib import rql_for_eid
    14 from cubicweb.uilib import rql_for_eid
    19 from cubicweb.web import INTERNAL_FIELD_VALUE, Redirect, RequestError
    15 from cubicweb.web import INTERNAL_FIELD_VALUE, Redirect, RequestError, json
    20 from cubicweb.entities.authobjs import CWUser
    16 from cubicweb.entities.authobjs import CWUser
    21 from cubicweb.web.views.autoform import get_pending_inserts, get_pending_deletes
    17 from cubicweb.web.views.autoform import get_pending_inserts, get_pending_deletes
    22 u = unicode
    18 u = unicode
    23 
    19 
    24 def req_form(user):
    20 def req_form(user):