Exemplo n.º 1
0
	def test_generate_drobox_auth(self):
		"""
		The ``generate_drobox_auth`` method should add the Dropbox auth URL
		and access token to the session.
		"""

		# Make sure the DropboxConfig class works
		session = DropboxConfig.get_session()
		self.assertNotEqual(session, None)

		# Call the method and make sure dropbox_auth_url and
		# request token were set
		s = SessionStore()
		view = URLUploadFormView()
		view.generate_drobox_auth(s)

		# The keys that the method should have generated exist
		self.assertTrue('dropbox_auth_url' in s.keys())
		self.assertTrue('request_token' in s.keys())

		# There is a valid dropbox URL
		parsed = urlparse(s['dropbox_auth_url'])
		self.assertEqual(parsed.netloc, 'www.dropbox.com')