def test_switch_on(self, render_mock): req = RequestFactory().get('/firefox/concerts') views.firefox_concerts(req) render_mock.assert_called_once_with(req, 'firefox/concerts.html')
def test_switch_on(self, render_mock): req = RequestFactory().get('/firefox/concerts') views.firefox_concerts(req) render_mock.assert_called_once_with(req, 'firefox/concerts.html')
def test_switch_off(self): req = RequestFactory().get('/firefox/concerts') res = views.firefox_concerts(req) assert res.status_code == 302 self.assertTrue(res['Location'].endswith(reverse('firefox')))
def test_switch_off(self): req = RequestFactory().get('/firefox/concerts') res = views.firefox_concerts(req) assert res.status_code == 302 self.assertTrue(res['Location'].endswith(reverse('firefox')))