You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
I'm using test driven development (going through Harry J.W. Percival's book) and have found that the following code fails because the template tag ( {% csrf_token %} ) is rendered by the home_page view function but not by the django.template.loader.render_to_string function (and so the assertEqual test fails.)
...templates/home.html: ... <form method="POST"> <input name="new_entity" id="id_new_entity" place_holder="Pick a name for your new entity." /> {% csrf_token %} </form> ...
returned_html and expected_html are the same except that returned_html contains the following line (and the other doesn't:) <input type='hidden' name='csrfmiddlewaretoken' value='Ev0j62rUtwdpOwjS5FN7B1VT38hE75W0JVZUJQy8IpcvzTH0MCexoRSpQvofoDoW' /> Infact, expected_html doesn't even contain the {% csrf_token %} line.
Can anyone suggest a work around? Thanks in advance.
Chris Wedgwood
unread,
Sep 27, 2017, 4:01:00 AM9/27/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message