Yes, this *should* work. But the trick is that in that assert, the strings have to be EXACTLY equal. I put in a couple print statments:

    print len(render(page))

    print len(u"<html>\n    {}\n    {}\n</html>".format(p1, p2))

and got:

---------------------------------------------- Captured stdout -----------------------------------------------
29
28

so there is an extra space or something in the render -- not really wrong, but makes the string not match.

Adding a strip() to both of those makes it work.

testing this kind of thing is tricky, as you don't necessarily need it to be exactly the same text, but it is easy to tes that way. 

I sometimes will run the code, look at the output, if it's correct, I copy and paste that to the test, and then the test will make sure that I don't break it later. Not exactly TDD, but it works...