

def test_authenticated(self):
    '\n        Testing authenticated users with a session store\n        and db storage\n        '
    request = mw.get_request()
    user = User.objects.create_user('john', 'lennon@thebeatles.com', 'johnpassword')
    default_tz = getattr(settings, 'TIME_ZONE', 'GMT')
    self.assertEqual(default_tz, user.tz)
    request.user = user
    mw = TimezonesMiddleware()
    request.COOKIES = {
        'timezone': 'Australia/Victoria',
    }
    mw.process_request(request)
    stored_user = User.objects.get(username='john')
    self.assertEqual(stored_user.tz, request.COOKIES['timezone'])
    self.assertEqual(request.session.get('timezone'), request.COOKIES['timezone'])

dataset/ETHPy150Open jamesmfriedman/django-easytz/easytz/tests.py TimezoneTestCase.test_authenticated/VarMisuse@14/43 `self`->`mw`