Esempio n. 1
0
File: test.py Progetto: 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)
Esempio n. 2
0
File: test.py Progetto: 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')
Esempio n. 3
0
File: test.py Progetto: 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)
Esempio n. 4
0
File: test.py Progetto: 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)