def test_preference_user(self):
        users = ((1, 'nl'),
                 (2, 'en'))

        for pk, lang in users:
            user = User.objects.get(pk=pk)
            profile = user.get_profile()

            req = self._get_request_with_user(user)

            # Check that the user has this preference
            self.failUnlessEqual(profile.language, lang)

            # Request should have a ``LANGUAGE_CODE`` with dutch
            UserenaLocaleMiddleware().process_request(req)
            self.failUnlessEqual(req.LANGUAGE_CODE, lang)
Initialize the relation on a set of models.
dataset/ETHPy150Open clione/django-kanban/src/core/userena/tests/middleware.py/UserenaLocaleMiddlewareTests.test_preference_user--crossover with--dataset/ETHPy150Open sdispater/orator/orator/orm/relations/belongs_to.py/BelongsTo.init_relation