def setUp(self): tag = TagCategory() self.post = Post(title='Primeiro post', text='<b>Nose test e fd</b>', tags=tag.string_to_category('python, nose, tdd')) self.post.put()
def test_apos_salvar_post_put_deve_retornar_a_chave_da_entidade(self): tag = TagCategory() post = Post(title='Primeiro post', text='<b>Nose test e fd</b>', tags=tag.string_to_category('python, nose, tdd')) assert_true(type(post.put().id()).__name__ == 'int') post.delete()
def setUp(self): self.app = app.test_client() tag = TagCategory() self.post = Post(title='Primeiro post', text='<b>Nose test e fd</b>', tags=tag.string_to_category('python, nose, tdd')) self.post.put() self.mocker = mocker.Mocker()
def test_delete_post(self): self.admin_loggend(5) tag = TagCategory() post = Post(title='Primeiro post', text='<b>Nose test e fd</b>', tags=tag.string_to_category('python, nose, tdd')) post.put() url="%i/delete" % post.key().id() self.app.get(url) post = Post.get_by_id( post.key().id() ) assert_true(post is None)
def test_retorno_string_to_category(self): tag = TagCategory() assert_equals([u'nose', u'python', u'tdd'], tag.string_to_category('python, nose, tdd'))
def test_verifica_se_tags_property_criado_corretamente(self): tag = TagCategory() categories = tag.string_to_category('python, nose, tdd') assert_equals(self.post.tags, categories)
def test_se_nao_for_passada_string_para_to_category_deve_levantar_uma_exception( self): tag = TagCategory() assert_raises(ValueError, tag.string_to_category, 123)