Example #1
0
 def test_auth_is_used_when_passed(self, treq_mock):
     """Test succesful user authentication."""
     username, password = '******', 'hunter2'
     client = RESTClient('http://base/', auth=(username, password))
     client.retrieve('resource', 1)
     args, kwargs = treq_mock.request.call_args
     self.assertTrue(kwargs['auth'] == (username, password))
Example #2
0
 def test_utf8(self, treq_mock):
     """Test succesful user authentication."""
     username, password = '******', 'hunter2'
     client = RESTClient(
         'http://base/',
         auth=(username, password),
     )
     client.list(
         'resource',
         params={'search': u"pijamalı hasta yağız şoföre çabucak güvendi"}
     )
     args, kwargs = treq_mock.request.call_args
     self.assertTrue(kwargs['auth'] == (username, password))
 def test_auth_is_used_when_passed(self, treq_mock):
     username, password = '******', 'hunter2'
     client = RESTClient('http://base/', auth=(username, password))
     client.retrieve('resource', 1)
     args, kwargs = treq_mock.request.call_args
     self.assertTrue(kwargs['auth'] == (username, password))