Beispiel #1
0
	def test_should_link_to_feed_for_a_logged_in_user(self):
		page = fixtures.stub_page()
		response = fixtures.app().get('/')
		
		response.mustcontain(page.title)

		user = fixtures.a_user
		email = user.email()
		user_handle = UserID.get(email).handle
		
		feed_link = 'https://localhost/feed/%s-%s/' % (user_handle, urllib2.quote(email))
		response.mustcontain('<link href="%s" type="application/rss+xml"' % (feed_link))
		response.mustcontain('<a href="%s"' % feed_link)
Beispiel #2
0
	def get(self, handle, email):
		email = urllib2.unquote(email)
		if not UserID.auth(email, int(handle)):
			info("invalid credentials: %s-%s" % (email, handle))
			raise HttpError(403, "invalid credentials... ")
		user = users.User(email)
		template_values = {
			'user': user.nickname(),
			'pages': Page.find_complete(user),
			'uri': self.uri(),
		}
		debug("template values: %r" % (template_values,))
		self.response.out.write(render('feed.rss', template_values))