Use builtin assertions

This commit is contained in:
Rafael Caricio 2015-07-19 12:25:39 +02:00
parent 9494a5ceac
commit d6833c8584
2 changed files with 7 additions and 7 deletions

View file

@ -24,28 +24,28 @@ class DjangoHTTPTestClientCompatibilityVows(DjangoContext):
expect(topic.status_code).to_equal(200)
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):
def topic(self):
return self.get('/say/?name=Rafael')
def should_say_hello_to_me(self, topic):
expect(topic.content).to_equal('Hello, Rafael!')
expect(topic).contains('Hello, Rafael!')
class SimplePost(DjangoContext):
def topic(self):
return self.post('/post_it/', {'value': 'posted!'})
def should_be_posted(self, topic):
expect(topic.content).to_equal('posted!')
expect(topic).contains('posted!')
class PostFile(DjangoContext):
def topic(self):
return self.post('/post_file/', {'the_file': open(self.TEST_FILE_PATH)})
def should_be_posted_to_the_server(self, topic):
expect(topic.content).to_equal("the contents")
expect(topic).contains("the contents")
class WhenNotFound(DjangoContext):
def topic(self):

View file

@ -26,7 +26,7 @@ class SettingsOverridingVows(DjangoContext):
expect(topic.status_code).to_equal(200)
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):
def topic(self):
@ -37,7 +37,7 @@ class SettingsOverridingVows(DjangoContext):
expect(topic.status_code).to_equal(200)
def should_(self, topic):
expect(topic.content).to_equal("Hello, guest!")
expect(topic).contains("Hello, guest!")
class UseDecoratorToChangeSettings(DjangoContext):
@override_settings(SAY_HELLO_WITHOUT_NAME=True)
@ -45,4 +45,4 @@ class SettingsOverridingVows(DjangoContext):
return self.get('/say/')
def should_say_hello_to_guest(self, topic):
expect(topic.content).to_equal("Hello, guest!")
expect(topic).contains("Hello, guest!")