コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 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)
コード例 #4
0
 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)