self.assertTemplateUsed bug?

12 views
Skip to first unread message

Mateusz Kurowski

unread,
Mar 28, 2018, 6:12:17 PM3/28/18
to Django users
Ive created a sample repository to demonstrate what i think is a bug.
 https://github.com/seospace/djangorendertostringtest < its fully usable django project,

 I encountered that bug again in my new project... its pretty frustrating... and this time without "render_to_string" i cant verify used templated.....

I think this must be checked by someone who knows this stuff, beacuse i suck.


Heres line that makes the "bug?" happen:

Here is simple test that will print used templates:
https://github.com/seospace/djangorendertostringtest/blob/master/djangorenderbug/renderbug/tests.py


And results are:

{'name': 'renderbug/email/body.txt', 'origin': <django.template.base.Origin object at 0x000001F8205BEE80>, 'engine': <django.template.engine.Engine object at 0x000001F81FB09978>, 'source': '', 'nodelist': []}
{'name': 'renderbug/theview.html', 'origin': <django.template.base.Origin object at 0x000001F8205CA1D0>, 'engine': <django.template.engine.Engine object at 0x000001F81FB09978>, 'source': '<!DOCTYPE html>\n<html lang="en">\n<head>
Reply all
Reply to author
Forward
0 new messages