<reponame>akornatskyy/wheezy.web<filename>demos/reusable/hello/src/hello/web/tests/test_views.py
import unittest

from app import main
from wheezy.http.functional import WSGIClient

path_for = main.options["path_for"]


class HelloTestCase(unittest.TestCase):
    def setUp(self):
        self.client = WSGIClient(main)

    def tearDown(self):
        self.client = None

    def path_for(self, name, **kwargs):
        return "/" + path_for("hello:" + name, **kwargs)

    def test_welcome(self):
        assert 200 == self.client.get(self.path_for("welcome"))
        assert "Hello World!" in self.client.content

import unittest

from app import main
from wheezy.http.functional import WSGIClient

path_for = main.options["path_for"]


class HelloTestCase(unittest.TestCase):
    def setUp(self):
        self.client = WSGIClient(main)

    def tearDown(self):
        self.client = None

    def path_for(self, name, **kwargs):
        return "/" + path_for("hello:" + name, **kwargs)

    def test_welcome(self):
        assert 200 == self.client.get(self.path_for("welcome"))
        assert "Hello World!" in self.client.content