Пример #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)
Пример #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)
Пример #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')
Пример #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')
Пример #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')
Пример #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')
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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')
Пример #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')
Пример #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)
Пример #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)
Пример #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')
Пример #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')
Пример #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)