From f5d05c5346daeecb503953c41d882f05f923cdf2 Mon Sep 17 00:00:00 2001 From: rafaelcaricio Date: Tue, 23 Aug 2011 11:46:09 -0700 Subject: [PATCH] Updated Django pyvows (markdown) --- Home.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Home.md b/Home.md index 5fdd78e..66c000c 100644 --- a/Home.md +++ b/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"`. \ No newline at end of file +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") + +``` \ No newline at end of file