Ticket #2296 (closed defect: fixed)

Opened 13 months ago

Last modified 13 months ago

TemplateAssertionError: no test named 'mapping'

Reported by: dustin Owned by:
Priority: major Milestone: 0.8.7
Version: master Keywords:
Cc:

Description

When viewing a log:

2012-05-12 09:57:51-0500 [HTTPChannel,0,172.16.1.18] Unhandled Error
        Traceback (most recent call last):
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/web/http.py", line 773, in requestReceived
            self.process()
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/web/server.py", line 132, in process
            self.render(resrc)
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/web/server.py", line 167, in render
            body = resrc.render(self)
          File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/status/web/base.py", line 326, in render
            d = defer.maybeDeferred(lambda : self.content(request, ctx))
        --- <exception caught here> ---
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 134, in maybeDeferred
            result = f(*args, **kw)
          File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/status/web/base.py", line 326, in <lambda>
            d = defer.maybeDeferred(lambda : self.content(request, ctx))
          File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/status/web/build.py", line 259, in content
            template = req.site.buildbot_service.templates.get_template("build.html")
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/jinja2/environment.py", line 716, in get_template
            return self._load_template(name, self.make_globals(globals))
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/jinja2/environment.py", line 690, in _load_template
            template = self.loader.load(self, name, globals)
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/jinja2/loaders.py", line 127, in load
            code = environment.compile(source, name, filename)
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/jinja2/environment.py", line 492, in compile
            self.handle_exception(exc_info, source_hint=source)
          File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/status/web/templates/build.html", line 154, in template
            {% if p.value is not mapping %}
        jinja2.exceptions.TemplateAssertionError: no test named 'mapping'

Change History

comment:1 Changed 13 months ago by dustin

  • master/buildbot/status/web/base.py

    commit cf4309e4ae34f37d2a11b473dc5886335abea896
    Author: Dustin J. Mitchell <dustin@mozilla.com>
    Date:   Sat May 12 10:07:34 2012 -0500
    
        add a 'mapping' test for Jinja
        
        This makes the template changes in c977f04d work.
    
    diff --git a/master/buildbot/status/web/base.py b/master/buildbot/status/web/base.py
    index 5e8902c..87050b3 100644
    a b def createJinjaEnv(revlink=None, changecommentlink=None, 
    514514 
    515515    env.install_null_translations() # needed until we have a proper i18n backend 
    516516 
     517    env.tests['mapping'] = lambda obj : isinstance(obj, dict) 
     518 
    517519    env.filters.update(dict( 
    518520        urlencode = urllib.quote, 
    519521        email = emailfilter, 
Last edited 13 months ago by dustin (previous) (diff)

comment:2 Changed 13 months ago by dustin

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.