def test_not_is_from_mobile_app(self): """ Verify the context is not from the mobile app. """ request = RequestFactory().get('/') request.META['HTTP_USER_AGENT'] = "Not from the mobile app" context = is_from_mobile_app(request) self.assertEqual(context['is_from_mobile_app'], False)
def test_not_is_from_mobile_app(self): """ Verify the context is not from the mobile app. """ request = RequestFactory().get('/') request.META['HTTP_USER_AGENT'] = "Not from the mobile app" context = is_from_mobile_app(request) self.assertEqual(context['is_from_mobile_app'], False)
def test_is_from_mobile_app(self): """ Verify the context is from mobile app. """ request = RequestFactory().get('/') request.META['HTTP_USER_AGENT'] = settings.MOBILE_APP_USER_AGENT_REGEXES[0] context = is_from_mobile_app(request) self.assertEqual(context['is_from_mobile_app'], True)
def test_is_from_mobile_app(self): """ Verify the context is from mobile app. """ request = RequestFactory().get('/') request.META[ 'HTTP_USER_AGENT'] = settings.MOBILE_APP_USER_AGENT_REGEXES[0] context = is_from_mobile_app(request) self.assertEqual(context['is_from_mobile_app'], True)