Ejemplo n.º 1
0
 def test_en_us_vC(self, render_mock):
     req = RequestFactory().get('/?v=c')
     req.locale = 'en-US'
     views.home(req)
     render_mock.assert_called_once_with(req,
                                         'mozorg/home/home-en-US-c.html',
                                         ANY)
Ejemplo n.º 2
0
 def test_home_quantum_template(self, render_mock):
     request = RequestFactory().get('/')
     request.locale = 'en-US'
     views.home(request)
     render_mock.assert_called_once_with(request,
                                         'mozorg/home/home-quantum.html',
                                         ANY)
Ejemplo n.º 3
0
 def test_gets_right_mobilizer_url(self, resp_mock):
     """Home page should get correct mobilizer link for locale."""
     req = self.rf.get('/')
     req.locale = 'de'
     views.home(req)
     ctx = resp_mock.call_args[0][2]
     self.assertEqual(ctx['mobilizer_link'], 'Herr Dude')
Ejemplo n.º 4
0
 def test_gets_right_mobilizer_url(self, resp_mock):
     """Home page should get correct mobilizer link for locale."""
     req = self.rf.get('/')
     req.locale = 'de'
     views.home(req)
     ctx = resp_mock.call_args[0][2]
     self.assertEqual(ctx['mobilizer_link'], 'Herr Dude')
Ejemplo n.º 5
0
 def test_gets_default_mobilizer_url(self, resp_mock):
     """Home page should get default mobilizer link for other locale."""
     req = self.rf.get('/')
     req.locale = 'xx'  # does not exist
     views.home(req)
     ctx = resp_mock.call_args[0][2]
     self.assertEqual(ctx['mobilizer_link'], 'His Dudeness')
Ejemplo n.º 6
0
 def test_gets_default_mobilizer_url(self, resp_mock):
     """Home page should get default mobilizer link for other locale."""
     req = self.rf.get('/')
     req.locale = 'xx'  # does not exist
     views.home(req)
     ctx = resp_mock.call_args[0][2]
     self.assertEqual(ctx['mobilizer_link'], 'His Dudeness')
Ejemplo n.º 7
0
 def test_old_home_template(self, render_mock):
     req = RequestFactory().get('/')
     req.locale = 'es-ES'
     views.home(req)
     render_mock.assert_called_once_with(req,
                                         'mozorg/home/home-voices.html',
                                         ANY)
Ejemplo n.º 8
0
 def test_non_en_us(self, render_mock):
     req = RequestFactory().get('/')
     req.locale = 'es-ES'
     views.home(req)
     render_mock.assert_called_once_with(req, 'mozorg/home/home.html', ANY)
Ejemplo n.º 9
0
 def test_valid_variant_invalid_locale(self, render_mock):
     req = self.rf.get('/?v=a')
     req.locale = 'fr'
     views.home(req)
     render_mock.assert_called_once_with(req,
         'mozorg/home/home.html', ANY)
Ejemplo n.º 10
0
 def test_valid_variant(self, render_mock):
     req = self.rf.get('/?v=b')
     req.locale = 'en-US'
     views.home(req)
     render_mock.assert_called_once_with(req,
         'mozorg/home/home-b.html', ANY)
Ejemplo n.º 11
0
 def test_old_home_template(self, render_mock):
     req = self.rf.get('/')
     req.locale = 'es-ES'
     views.home(req)
     render_mock.assert_called_once_with(req,
         'mozorg/home/home-voices.html', ANY)
Ejemplo n.º 12
0
 def test_en_us(self, render_mock):
     req = self.rf.get('/')
     req.locale = 'en-US'
     views.home(req)
     render_mock.assert_called_once_with(req,
         'mozorg/home/home.html', ANY)
Ejemplo n.º 13
0
 def test_valid_variant_invalid_locale(self, render_mock):
     req = self.rf.get('/?v=a')
     req.locale = 'fr'
     views.home(req)
     render_mock.assert_called_once_with(req, 'mozorg/home/home.html', ANY)
Ejemplo n.º 14
0
 def test_en_us_invalid_variant(self, render_mock):
     req = RequestFactory().get('/?v=d')
     req.locale = 'en-US'
     views.home(req)
     render_mock.assert_called_once_with(req,
         'mozorg/home/home-en-US.html', ANY)
Ejemplo n.º 15
0
 def test_home_2016_template(self, render_mock):
     request = RequestFactory().get('/')
     request.locale = 'de'
     views.home(request)
     render_mock.assert_called_once_with(request, 'mozorg/home/home.html')
Ejemplo n.º 16
0
 def test_home_enUS(self, render_mock):
     request = RequestFactory().get('/')
     request.locale = 'en-US'
     views.home(request)
     render_mock.assert_called_once_with(request,
                                         'mozorg/home/home-new.html')
Ejemplo n.º 17
0
 def test_en_us(self, render_mock):
     req = self.rf.get('/')
     req.locale = 'en-US'
     views.home(req)
     render_mock.assert_called_once_with(req, 'mozorg/home/home.html', ANY)
Ejemplo n.º 18
0
 def test_non_en_us(self, render_mock):
     req = RequestFactory().get('/')
     req.locale = 'es-ES'
     views.home(req)
     render_mock.assert_called_once_with(req,
         'mozorg/home/home.html', ANY)
Ejemplo n.º 19
0
 def test_home_non_enUS(self, render_mock):
     request = RequestFactory().get('/')
     request.locale = 'fr'
     views.home(request)
     render_mock.assert_called_once_with(request, 'mozorg/home/home.html')
Ejemplo n.º 20
0
 def test_home_non_enUS_experiment_disabled(self, render_mock):
     request = RequestFactory().get('/')
     request.locale = 'fr'
     views.home(request)
     render_mock.assert_called_once_with(request, 'mozorg/home/home.html')
Ejemplo n.º 21
0
 def test_valid_variant(self, render_mock):
     req = self.rf.get('/?v=b')
     req.locale = 'en-US'
     views.home(req)
     render_mock.assert_called_once_with(req, 'mozorg/home/home-b.html',
                                         ANY)