Exemple #1
0
 def test_resulting_dict(self):
     self.kwargs = {
         'params': ['Accept-Language', 'X-Geobase-Id', 'Not-Existing-Header'],
         'view_instance': None,
         'view_method': None,
         'request': factory.get('', **{
             'HTTP_ACCEPT_LANGUAGE': 'Ru',
             'HTTP_X_GEOBASE_ID': 123
         }),
         'args': None,
         'kwargs': None
     }
     expected = {
         'accept-language': u'Ru',
         'x-geobase-id': u'123'
     }
     self.assertEqual(HeadersKeyBit().get_data(**self.kwargs), expected)
Exemple #2
0
class RequestKeyConstructor(DefaultKeyConstructor):
    arguments = ArgsKeyBit()
    key_arguments = KwargsKeyBit()
    query_params = QueryParamsKeyBit()
    user = UserKeyBit()
    headers = HeadersKeyBit()