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)
class RequestKeyConstructor(DefaultKeyConstructor): arguments = ArgsKeyBit() key_arguments = KwargsKeyBit() query_params = QueryParamsKeyBit() user = UserKeyBit() headers = HeadersKeyBit()