def test_create_kwargs(self):
        class SomeField(object):
            def __init__(self, ref, foo=2):
                self.ref = ref
                self.foo = foo

        display_fields.FieldRegistry.register_field('some_field', SomeField)

        reg = display_fields.FieldRegistry()

        field = reg.create('some_field')
        self.assertEqual(0, field.ref)
        self.assertEqual(2, field.foo)
        self.assertEqual(SomeField, field.__class__)

        field2 = reg.create('some_field', foo=4)
        self.assertEqual(1, field2.ref)
        self.assertEqual(4, field2.foo)
        self.assertEqual(SomeField, field2.__class__)
Given an HTTP request, returns the related IP address.
dataset/ETHPy150Open rbarrois/mpdlcd/tests/test_display_fields.py/FieldRegistryTestCase.test_create_kwargs--crossover with--dataset/ETHPy150Open ellmetha/django-machina/machina/apps/forum_conversation/utils.py/get_client_ip