Use builtin assertions
This commit is contained in:
parent
9494a5ceac
commit
d6833c8584
2 changed files with 7 additions and 7 deletions
|
@ -24,28 +24,28 @@ class DjangoHTTPTestClientCompatibilityVows(DjangoContext):
|
||||||
expect(topic.status_code).to_equal(200)
|
expect(topic.status_code).to_equal(200)
|
||||||
|
|
||||||
def should_ask_for_my_name(self, topic):
|
def should_ask_for_my_name(self, topic):
|
||||||
expect(topic.content).to_equal('What\'s your name?')
|
expect(topic).contains('What\'s your name?')
|
||||||
|
|
||||||
class SimpleGetWithParams(DjangoContext):
|
class SimpleGetWithParams(DjangoContext):
|
||||||
def topic(self):
|
def topic(self):
|
||||||
return self.get('/say/?name=Rafael')
|
return self.get('/say/?name=Rafael')
|
||||||
|
|
||||||
def should_say_hello_to_me(self, topic):
|
def should_say_hello_to_me(self, topic):
|
||||||
expect(topic.content).to_equal('Hello, Rafael!')
|
expect(topic).contains('Hello, Rafael!')
|
||||||
|
|
||||||
class SimplePost(DjangoContext):
|
class SimplePost(DjangoContext):
|
||||||
def topic(self):
|
def topic(self):
|
||||||
return self.post('/post_it/', {'value': 'posted!'})
|
return self.post('/post_it/', {'value': 'posted!'})
|
||||||
|
|
||||||
def should_be_posted(self, topic):
|
def should_be_posted(self, topic):
|
||||||
expect(topic.content).to_equal('posted!')
|
expect(topic).contains('posted!')
|
||||||
|
|
||||||
class PostFile(DjangoContext):
|
class PostFile(DjangoContext):
|
||||||
def topic(self):
|
def topic(self):
|
||||||
return self.post('/post_file/', {'the_file': open(self.TEST_FILE_PATH)})
|
return self.post('/post_file/', {'the_file': open(self.TEST_FILE_PATH)})
|
||||||
|
|
||||||
def should_be_posted_to_the_server(self, topic):
|
def should_be_posted_to_the_server(self, topic):
|
||||||
expect(topic.content).to_equal("the contents")
|
expect(topic).contains("the contents")
|
||||||
|
|
||||||
class WhenNotFound(DjangoContext):
|
class WhenNotFound(DjangoContext):
|
||||||
def topic(self):
|
def topic(self):
|
||||||
|
|
|
@ -26,7 +26,7 @@ class SettingsOverridingVows(DjangoContext):
|
||||||
expect(topic.status_code).to_equal(200)
|
expect(topic.status_code).to_equal(200)
|
||||||
|
|
||||||
def should_ask_for_my_name(self, topic):
|
def should_ask_for_my_name(self, topic):
|
||||||
expect(topic.content).to_equal("What's your name?")
|
expect(topic).contains("What's your name?")
|
||||||
|
|
||||||
class SayHelloWithoutName(DjangoContext):
|
class SayHelloWithoutName(DjangoContext):
|
||||||
def topic(self):
|
def topic(self):
|
||||||
|
@ -37,7 +37,7 @@ class SettingsOverridingVows(DjangoContext):
|
||||||
expect(topic.status_code).to_equal(200)
|
expect(topic.status_code).to_equal(200)
|
||||||
|
|
||||||
def should_(self, topic):
|
def should_(self, topic):
|
||||||
expect(topic.content).to_equal("Hello, guest!")
|
expect(topic).contains("Hello, guest!")
|
||||||
|
|
||||||
class UseDecoratorToChangeSettings(DjangoContext):
|
class UseDecoratorToChangeSettings(DjangoContext):
|
||||||
@override_settings(SAY_HELLO_WITHOUT_NAME=True)
|
@override_settings(SAY_HELLO_WITHOUT_NAME=True)
|
||||||
|
@ -45,4 +45,4 @@ class SettingsOverridingVows(DjangoContext):
|
||||||
return self.get('/say/')
|
return self.get('/say/')
|
||||||
|
|
||||||
def should_say_hello_to_guest(self, topic):
|
def should_say_hello_to_guest(self, topic):
|
||||||
expect(topic.content).to_equal("Hello, guest!")
|
expect(topic).contains("Hello, guest!")
|
||||||
|
|
Reference in a new issue