Updated Django pyvows (markdown)

rafaelcaricio 2011-08-23 11:46:09 -07:00
parent 8462f30cab
commit f5d05c5346

36
Home.md

@ -47,4 +47,38 @@ class ContextTest(DjangoHTTPContext):
```
To work you only need to override the `get_settings` method from DjangoHTTPContext to
return the path of your settings module. The default `get_settings` returns `"settings"`.
return the path of your settings module. The default `get_settings` returns `"settings"`.
You can start more than one server with different configurations that you can specify. Like this:
```python
from pyvows import Vows, expect
from django_pyvows import DjangoContext, DjangoHTTPContext
@Vows.batch
class ContextTest(DjangoContext):
class TheDefaultSetting(DjangoHTTPContext):
def setup(self):
self.start_server(port=8081)
def topic(self):
return self.get("/homepage/")
def should_be_ok(self, topic):
expect(topic.code).to_equal("OK")
class TheOtherSetting(DjangoHTTPContext):
def setup(self):
self.start_server(port=8082)
def topic(self):
return self.get("/homepage/")
def should_be_ok(self, topic):
expect(topic.code).to_equal("OK")
```