Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
Adding language format to code sample in readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcaricio committed Aug 23, 2011
1 parent 438c529 commit 2d8bd04
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions README.md
Expand Up @@ -22,24 +22,26 @@ Using Django-Pyvows
There is no need to modify your project to use Django-PyVows. You only have to create the vows There is no need to modify your project to use Django-PyVows. You only have to create the vows
as you usually would, start the server and call your project urls: as you usually would, start the server and call your project urls:


from pyvows import Vows, expect ```python
from pyvows import Vows, expect


from django_pyvows.context import DjangoHTTPContext from django_pyvows.context import DjangoHTTPContext


@Vows.batch @Vows.batch
class ContextTest(DjangoHTTPContext): class ContextTest(DjangoHTTPContext):


def setup(self): def setup(self):
self.start_server() self.start_server()


def topic(self): def topic(self):
return self.get('/mygreaturl/') return self.get('/mygreaturl/')


def should_be_a_success(self, topic): def should_be_a_success(self, topic):
expect(topic.getcode()).to_equal(200) expect(topic.getcode()).to_equal(200)


def should_return_the_correct_response_type(self, topic): def should_return_the_correct_response_type(self, topic):
expect(topic.headers.type).to_equal("text/html") expect(topic.headers.type).to_equal("text/html")
```


To work you only need to override the `get_settings` method from DjangoHTTPContext to 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"`.
Expand Down

0 comments on commit 2d8bd04

Please sign in to comment.