This repository has been archived on 2023-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
django-pyvows/vows/view_vows.py

31 lines
794 B
Python
Raw Normal View History

2011-05-10 00:30:27 +00:00
#!/usr/bin/python
# -*- coding: utf-8 -*-
# django-pyvows extensions
# https://github.com/rafaelcaricio/django-pyvows
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 Rafael Caricio rafael@caricio.com
from pyvows import Vows, expect
2011-05-10 02:14:48 +00:00
from django_pyvows.context import DjangoContext
2011-08-18 14:28:51 +00:00
DjangoContext._start_environment("sandbox.settings")
2011-05-10 00:30:27 +00:00
from sandbox.main.views import home
@Vows.batch
2011-08-18 14:28:51 +00:00
class ViewVows(DjangoContext):
2011-05-10 00:30:27 +00:00
2011-05-10 02:14:48 +00:00
class Home(DjangoContext):
2011-05-10 00:30:27 +00:00
def topic(self):
return home(self._request())
def should_be_instance_of_http_response(self, topic):
expect(topic).to_be_http_response()
def should_be_hello_world(self, topic):
expect(topic).to_have_contents_of('Hello World')