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/context_vows.py

32 lines
854 B
Python
Raw Normal View History

2011-05-06 02:53:07 +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
2011-05-09 23:53:52 +00:00
from pyvows import Vows, expect
2015-07-18 20:33:33 +00:00
from pyvows.decorators import capture_error
from django_pyvows.context import DjangoContext
2011-05-09 23:53:52 +00:00
@Vows.batch
class ContextTest(Vows.Context):
2015-07-18 20:33:33 +00:00
@capture_error
2011-05-09 23:53:52 +00:00
def topic(self):
2015-07-19 09:42:54 +00:00
return DjangoContext.setup_environment(None)
2011-05-09 23:53:52 +00:00
def should_be_an_error(self, topic):
expect(topic).to_be_an_error()
def should_be_runtime_error(self, topic):
2015-07-18 20:33:33 +00:00
expect(topic).to_be_an_error_like(ValueError)
2011-05-09 23:53:52 +00:00
def should_have_nice_error_message(self, topic):
2011-05-10 02:14:48 +00:00
expect(topic).to_have_an_error_message_of('The settings_path argument is required.')