示例#1
0
    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()
示例#2
0
	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()
示例#3
0
	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()
示例#4
0
    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()
示例#5
0
	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()
示例#6
0
	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)	
示例#7
0
	def test_retorno_string_to_category(self):
		tag = TagCategory()
		assert_equals([u'nose', u'python', u'tdd'], 
					  tag.string_to_category('python, nose, tdd'))
示例#8
0
	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)
示例#9
0
 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)
示例#10
0
 def test_retorno_string_to_category(self):
     tag = TagCategory()
     assert_equals([u'nose', u'python', u'tdd'],
                   tag.string_to_category('python, nose, tdd'))
示例#11
0
 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)