#NEWLINE# def test_generic_sitemap( self ) : #NEWLINE# #INDENT# 'A minimal generic sitemap can be rendered' #NEWLINE# response = self . client . get ( '/generic/sitemap.xml' ) #NEWLINE# expected = '' #NEWLINE# for username in User . objects . values_list ( 'username' , flat = True ) : #NEWLINE# #INDENT# expected += ( '<url><loc>%s/users/%s/</loc></url>' % ( username . base_url , username ) ) #NEWLINE# #UNINDENT# expected_content = ( '<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n%s\n</urlset>\n' % expected ) #NEWLINE# self . assertXMLEqual ( response . content . decode ( 'utf-8' ) , expected_content )