New version.
This commit is contained in:
parent
47c55f38d4
commit
4b6ba76a38
2 changed files with 6 additions and 6 deletions
|
@ -174,11 +174,11 @@ class DjangoContext(Vows.Context):
|
||||||
def model(self, model_class):
|
def model(self, model_class):
|
||||||
return Model(self, model_class)
|
return Model(self, model_class)
|
||||||
|
|
||||||
def get(self, url):
|
def get(self, path):
|
||||||
return urllib2.urlopen(url)
|
return urllib2.urlopen(self.get_url(path))
|
||||||
|
|
||||||
def post(self, url, params):
|
def post(self, path, params):
|
||||||
return urllib2.urlopen(url, data=params)
|
return urllib2.urlopen(self.get_url(path), data=params)
|
||||||
|
|
||||||
def get_url(self, path):
|
def get_url(self, path):
|
||||||
ctx = self.parent
|
ctx = self.parent
|
||||||
|
@ -186,7 +186,7 @@ class DjangoContext(Vows.Context):
|
||||||
if hasattr(ctx, 'get_url'):
|
if hasattr(ctx, 'get_url'):
|
||||||
return ctx.get_url(path)
|
return ctx.get_url(path)
|
||||||
ctx = ctx.parent
|
ctx = ctx.parent
|
||||||
return None
|
return ""
|
||||||
|
|
||||||
class DjangoHTTPContext(DjangoContext):
|
class DjangoHTTPContext(DjangoContext):
|
||||||
|
|
||||||
|
|
|
@ -8,4 +8,4 @@
|
||||||
# http://www.opensource.org/licenses/mit-license
|
# http://www.opensource.org/licenses/mit-license
|
||||||
# Copyright (c) 2011 Rafael Caricio rafael@caricio.com
|
# Copyright (c) 2011 Rafael Caricio rafael@caricio.com
|
||||||
|
|
||||||
__version__ = (0, 1, 0)
|
__version__ = (0, 2, 0)
|
||||||
|
|
Reference in a new issue