Example #1
0
 def test_files_get_bad_credentials(self):
     """
     Test getting improperly formatted credentials from header
     """
     files_view = FilesView()
     encoded_creds = base64.encodestring('blah')
     headers = {'HTTP_AUTHORIZATION': encoded_creds}
     creds = files_view._get_credentials(headers)
     self.assertEqual(creds, None)
Example #2
0
 def test_files_get_bad_credentials(self):
     """
     Test getting improperly formatted credentials from header
     """
     files_view = FilesView()
     encoded_creds = base64.encodestring('blah')
     headers = {'HTTP_AUTHORIZATION': encoded_creds}
     creds = files_view._get_credentials(headers)
     self.assertEqual(creds, None)
Example #3
0
 def test_files_get_credentials(self):
     """
     Test getting credentials from header
     """
     files_view = FilesView()
     real_creds = ('test', '123')
     encoded_creds = base64.encodestring('test:123')
     headers = {'HTTP_AUTHORIZATION': encoded_creds}
     creds = files_view._get_credentials(headers)
     self.assertEqual(real_creds, creds)
Example #4
0
 def test_files_get_credentials(self):
     """
     Test getting credentials from header
     """
     files_view = FilesView()
     real_creds = ('test', '123')
     encoded_creds = base64.encodestring('test:123')
     headers = {'HTTP_AUTHORIZATION': encoded_creds}
     creds = files_view._get_credentials(headers)
     self.assertEqual(real_creds, creds)