Adam Knight avatar Adam Knight committed 0af34f1

Fixed unit tests.

Comments (0)

Files changed (4)

-.hgignore
-.hg
-\.DS_Store
-\.pyc$
-settings_local.py
-sitepoet.sqlite
-wiki
-ve
+syntax:glob
+.DS_Store
+*.pyc

.hgignore

-\.DS_Store
-\.pyc$
-settings_local.py
-sitepoet.sqlite
-wiki
-ve
-.git
 		pass
 	
 	def testContentFormattingNone(self):
-		obj = Page(title="Format Test", path="/format-test")
+		obj = Page(title="Format Test", url="/format-test")
 		obj.content = "*None* _test_ <b>woo!</b>"
 		obj.content_format = CONTENT_FORMAT_NONE
 		self.assertEqual(obj.formatted_content, obj.content, "Invalid result: "+obj.formatted_content)
 	
 	def testContentFormattingTextile(self):
-		obj = Page(title="Format Test", path="/format-test")
+		obj = Page(title="Format Test", url="/format-test")
 		obj.content = "p(foo). *Textile* _test_"
 		obj.content_format = CONTENT_FORMAT_TEXTILE
 		self.assertEqual(obj.formatted_content, '\t<p class="foo"><strong>Textile</strong> <em>test</em></p>', "Invalid result: "+obj.formatted_content)
 	
 	def testContentFormattingMarkdown(self):
-		obj = Page(title="Format Test", path="/format-test")
+		obj = Page(title="Format Test", url="/format-test")
 		obj.content = "*Markdown* _test_"
 		obj.content_format = CONTENT_FORMAT_MARKDOWN
 		self.assertEqual(obj.formatted_content, '<p><em>Markdown</em> <em>test</em></p>', "Invalid result: "+obj.formatted_content)
 	
 	def testAbsoluteURL(self):
-		obj = Page()
-		obj.title="URL Test"
-		obj.path="url-test"
-		obj.content="Hey, hey, we're the Monkees!"
-		obj.content_format=CONTENT_FORMAT_NONE
+		obj = Page(title="URL Test", url="/url-test")
 		obj.save()
-
 		obj.sites = [settings.SITE_ID]
 		obj.save()
 		
 		url = obj.get_absolute_url()
 		
 		response = self.client.get(url)
-		# print response
 		self.assertEqual(response.status_code, 200, "Could not load page at the URL it claims it's at (%d): %s" % (response.status_code, url))
 		
 		obj.delete()
 		r.delete()
 	
 	def testObjectRedirectTemporary(self):
-		obj = Page(title="TestTemp", path="test-temp", content="Lorum ipsum etc.")
+		obj = Page(title="TestTemp", url="/test-temp", content="Lorum ipsum etc.")
 		obj.save()
 		obj.sites = [settings.SITE_ID]
 		obj.save()
 		obj.delete()
 	
 	def testObjectRedirectPermanent(self):
-		obj = Page(title="TestPerm", path="test-perm", content="Lorum ipsum etc.")
+		obj = Page(title="TestPerm", url="/test-perm", content="Lorum ipsum etc.")
 		obj.save()
 		obj.sites = [settings.SITE_ID]
 		obj.save()
 		obj.delete()
 	
 	def testMissingObjectRedirect(self):
-		obj = Page(title="TestGone", path="/test-gone", content="Lorum ipsum etc.")
+		obj = Page(title="TestGone", url="/test-gone", content="Lorum ipsum etc.")
 		obj.save()
 		obj.sites = [settings.SITE_ID]
 		obj.save()
 			return HttpResponseRedirect("%s/" % request.path_info)
 		
 		# Otherwise, give up.
-		print request.path_info, url
+		# print request.path_info, url
 		raise Http404
 	
 	except Page.MultipleObjectsReturned, e:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.