Exemplo n.º 1
0
	def test_delete(self):
		from columns.model import Page
		tmp = Page.get_from_id(1)
		assert tmp != None
		response = self.app.delete(url('page', id=1), extra_environ=self.extra_environ)
		tmp = Page.get_from_id(1)
		assert tmp == None
Exemplo n.º 2
0
	def test_update(self):
		response = self.app.put(url('page', id=1), extra_environ=self.extra_environ, params=dict(
			title=u'Main',slug=u'main',content=u'',template=u'/blog/stream',
			stream_comment_style=u'summary',story_comment_style=u'list',
			visible=False,can_post=True,in_main=True,#tweet=False,
		))
		from columns.model import Page
		tmp = Page.get_from_id(1)
		assert tmp.title == u'Main'
		assert tmp.slug == u'main'
		assert tmp.content == u''
		assert tmp.template == u'/blog/stream'
		assert tmp.stream_comment_style == u'summary'
		assert tmp.story_comment_style == u'list'
		assert tmp.visible == False
		assert tmp.can_post == True
		assert tmp.in_main == True
Exemplo n.º 3
0
	def test_update_json(self):
		response = self.app.put(url('formatted_page', format='json', id=1), extra_environ=self.extra_environ, content_type='application/json', body=json.dumps(dict(
			title=u'Main',slug=u'main',content=u'',template=u'/blog/stream',
			stream_comment_style=u'summary',story_comment_style=u'list',
			visible=False,can_post=True,in_main=True,#tweet=False,
		)))
		from columns.model import Page
		tmp = Page.get_from_id(1)
		assert tmp.title == u'Main'
		assert tmp.slug == u'main'
		assert tmp.content == u''
		assert tmp.template == u'/blog/stream'
		assert tmp.stream_comment_style == u'summary'
		assert tmp.story_comment_style == u'list'
		assert tmp.visible == False
		assert tmp.can_post == True
		assert tmp.in_main == True
Exemplo n.º 4
0
	def test_delete_browser_fakeout(self):
		response = self.app.post(url('page', id=1), extra_environ=self.extra_environ, params=dict(_method='delete'))
		from columns.model import Page
		tmp = Page.get_from_id(1)
		assert tmp == None