Пример #1
0
def test_claim(db):
    resp = poems.claim(5, u'unicode snowman ☃', author='me')
    db.haiku.update.assert_called_with({'message': u'unicode snowman ☃'},
                                       {'$set': {
                                           'author': 'me'
                                       }})
    assert resp == u'me has claimed the line: unicode snowman ☃'
Пример #2
0
def test_claim_unknown_line(db):
    db.haiku.update.side_effect = Exception
    resp = poems.claim(5, u'unicode snowman ☃', author='me')
    assert resp == "Sorry, I don't know that line."
Пример #3
0
def test_claim(db):
    resp = poems.claim(5, u'unicode snowman ☃', author='me')
    db.haiku.update.assert_called_with({'message': u'unicode snowman ☃'},
                                       {'$set': {'author': 'me'}})
    assert resp == u'me has claimed the line: unicode snowman ☃'
Пример #4
0
def test_claim_unknown_line(db):
    db.haiku.update.side_effect = Exception
    resp = poems.claim(5, u'unicode snowman ☃', author='me')
    assert resp == "Sorry, I don't know that line."