web/test/unittest_views_basetemplates.py
changeset 8976 aeb7d400ee92
parent 8544 3d049071957e
child 9042 6cc13a0a9145
equal deleted inserted replaced
8975:045e449617ad 8976:aeb7d400ee92
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    14 # details.
    14 # details.
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
       
    18 
    18 from cubicweb.devtools.testlib import CubicWebTC
    19 from cubicweb.devtools.testlib import CubicWebTC
    19 from cubicweb.devtools.htmlparser import DTDValidator
    20 from cubicweb.devtools.htmlparser import XMLValidator
    20 
    21 
    21 
    22 
    22 class LogFormTemplateTC(CubicWebTC):
    23 class LogFormTemplateTC(CubicWebTC):
    23 
    24 
    24     def _login_labels(self):
    25     def _login_labels(self):
    25         valid = self.content_type_validators.get('text/html', DTDValidator)()
    26         valid = self.content_type_validators.get('text/html', XMLValidator)()
    26         req = self.request()
    27         req = self.request()
    27         req.cnx.anonymous_connection = True
    28         req.cnx.anonymous_connection = True
    28         page = valid.parse_string(self.vreg['views'].main_template(self.request(), 'login'))
    29         page = valid.parse_string(self.vreg['views'].main_template(self.request(), 'login'))
    29         req.cnx.anonymous_connection = False
    30         req.cnx.anonymous_connection = False
    30         return page.find_tag('label')
    31         return page.find_tag('label')