view kallithea/tests/functional/test_feed.py @ 5922:7f2aa3ec2931

pytest migration: rename TestControllerPytest back to TestController The name TestControllerPytest was introduced to allow a temporary situation where nose/unittest and pytest-based tests could coexist. This situation is now over, so the base test class can be renamed again.
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Sun, 15 May 2016 22:37:37 +0200
parents 5adc4ad9ce77
children 8d98924c58b1
line wrap: on
line source

from kallithea.tests import *

class TestFeedController(TestController):

    def test_rss(self):
        self.log_user()
        response = self.app.get(url(controller='feed', action='rss',
                                    repo_name=HG_REPO))



        assert response.content_type == "application/rss+xml"
        assert """<rss version="2.0">""" in response

    def test_atom(self):
        self.log_user()
        response = self.app.get(url(controller='feed', action='atom',
                                    repo_name=HG_REPO))

        assert response.content_type == """application/atom+xml"""
        assert """<?xml version="1.0" encoding="utf-8"?>""" in response
        assert """<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">""" in response