示例#1
0
 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')
示例#2
0
 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')
示例#3
0
 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')))
示例#4
0
 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')))