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)
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)
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')
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')
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)
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)
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)
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)
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)
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)
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)
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')
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')
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')
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')