示例#1
0
文件: test.py 项目: tommed/qkweb
	def test_showItem1(self):
		set_cgi('GET', 'id=123')
		out = MyStdout()
		self.capture_stdout(out)
		Runner.scaffold(MockPersistentObject, db, model)
		self.reset_stdout()
		self.assertMime('text/html', out)
		html = '\n'.join(out.content)
		self.assertTrue(html.find('TODO! read item 123') != -1)
示例#2
0
文件: test.py 项目: tommed/qkweb
	def test_create(self):
		set_cgi('GET', 'a=create')
		out = MyStdout()
		self.capture_stdout(out)
		Runner.scaffold(MockPersistentObject, db, model)
		self.reset_stdout()
		self.assertMime('text/html', out)
		html = '\n'.join(out.content)
		self.assertTrue(html.find('TODO! draw create form') != -1, 'TODO statement not found')
示例#3
0
文件: test.py 项目: tommed/qkweb
	def test_postCreate1(self):
		set_cgi('POST', '')
		out = MyStdout()
		self.capture_stdout(out)
		Runner.scaffold(MockPersistentObject, db, model)
		self.reset_stdout()
		self.assertMime('text/html', out)
		html = '\n'.join(out.content)
		self.assertTrue(html.find('TODO! create new item') != -1)
示例#4
0
文件: test.py 项目: tommed/qkweb
	def test_noGETDelete(self):
		set_cgi('GET', 'a=delete')
		out = MyStdout()
		self.capture_stdout(out)
		Runner.scaffold(MockPersistentObject, db, model)
		self.reset_stdout()
		self.assertMime('text/html', out)
		html = '\n'.join(out.content)
		self.assertTrue(html.find('NOT IMPLEMENTED') != -1)