view MoinMoin/apps/misc/_tests/test_misc.py @ 1364:582e7109a8c1

mass update - delete trailing spaces and/or add blank line to end of file
author Roger Haase <crosseyedpenguin@yahoo.com>
date Wed, 06 Jun 2012 15:03:07 -0700
parents d37908dbf793
children 4ac437141bbe
line wrap: on
line source
# Copyright: 2010,2011 MoinMoin:ThomasWaldmann
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
MoinMoin - basic tests for misc views
"""

from flask import url_for

from MoinMoin._tests import wikiconfig

class TestMisc(object):
    class Config(wikiconfig.Config):
        """
        we just have this so the test framework creates a new app with empty backends for us.
        """

    def test_global_sitemap(self):
        with self.app.test_client() as c:
            rv = c.get(url_for('misc.sitemap'))
            assert rv.status == '200 OK'
            assert rv.headers['Content-Type'] == 'text/xml; charset=utf-8'
            assert rv.data.startswith('<?xml')
            assert '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' in rv.data
            assert '</urlset>' in rv.data

    def test_urls_names(self):
        with self.app.test_client() as c:
            rv = c.get(url_for('misc.urls_names'))
            assert rv.status == '200 OK'
            assert rv.headers['Content-Type'] == 'text/plain; charset=utf-8'