def test_get_release_or_404(self, get_release): eq_(views.get_release_or_404('version', 'product'), get_release.return_value) get_release.assert_called_with('product', 'version') get_release.side_effect = ReleaseNotFound with self.assertRaises(Http404): views.get_release_or_404('version', 'product')
def test_non_public_release(self, get_object_or_404): """ Should raise 404 if not release.is_public and not settings.DEV """ get_object_or_404.return_value = Release(is_public=False) with self.assertRaises(Http404): views.get_release_or_404('42', 'Firefox')
def test_non_public_release(self, get_release): """ Should raise 404 if release is not public and not settings.DEV """ get_release.return_value = None with self.assertRaises(Http404): views.get_release_or_404('42', 'Firefox')
def test_get_release_or_404(self, get_release): assert views.get_release_or_404("version", "product") == get_release.return_value get_release.assert_called_with("product", "version", None, False) get_release.return_value = None with self.assertRaises(Http404): views.get_release_or_404("version", "product")
def test_get_release_or_404(self, get_release): eq_(views.get_release_or_404('version', 'product'), get_release.return_value) get_release.assert_called_with('product', 'version', None, False) get_release.return_value = None with self.assertRaises(Http404): views.get_release_or_404('version', 'product')
def test_get_release_or_404(self, get_release): assert (views.get_release_or_404( 'version', 'product') == get_release.return_value) get_release.assert_called_with('product', 'version', None, False) get_release.return_value = None with self.assertRaises(Http404): views.get_release_or_404('version', 'product')
def test_non_public_release(self): """ Should raise 404 if release is not public and not settings.DEV, unless the include_drafts option is enabled """ with self.assertRaises(Http404): views.get_release_or_404('58.0a1', 'Firefox') eq_( views.get_release_or_404('58.0a1', 'Firefox', True).is_public, False)
def test_get_release_or_404(self, Q, get_object_or_404): eq_(views.get_release_or_404('version', 'product'), get_object_or_404.return_value) get_object_or_404.assert_called_with(Release, Q.return_value, version='version') Q.assert_called_once_with(product='product')
def test_non_public_release(self): """ Should raise 404 if release is not public and not settings.DEV, unless the include_drafts option is enabled """ with self.assertRaises(Http404): views.get_release_or_404('58.0a1', 'Firefox') eq_(views.get_release_or_404('58.0a1', 'Firefox', True).is_public, False) with self.assertRaises(Http404): views.get_release_or_404('58.0a1', 'Firefox for Android') eq_(views.get_release_or_404('58.0a1', 'Firefox for Android', True).is_public, False)
def test_non_public_release(self): """ Should raise 404 if release is not public and not settings.DEV, unless the include_drafts option is enabled """ with self.assertRaises(Http404): views.get_release_or_404("58.0a1", "Firefox") assert not views.get_release_or_404("58.0a1", "Firefox", True).is_public with self.assertRaises(Http404): views.get_release_or_404("58.0a1", "Firefox for Android") assert not views.get_release_or_404("58.0a1", "Firefox for Android", True).is_public
def test_get_release_or_404_esr(self): rel = views.get_release_or_404('24.5.0', 'Firefox') eq_(rel.version, '24.5.0') eq_(rel.channel, 'ESR')
def test_get_release_or_404_endswith_esr(self): rel = views.get_release_or_404("45.0esr", "Firefox") assert rel.version == "45.0esr" assert rel.channel == "ESR"
def test_get_release_or_404_esr(self): rel = views.get_release_or_404("24.5.0", "Firefox") assert rel.version == "24.5.0" assert rel.channel == "ESR"
def test_get_release_or_404_esr(self): rel = views.get_release_or_404('24.5.0', 'Firefox') assert rel.version == '24.5.0' assert rel.channel == 'ESR'
def test_get_release_or_404_endswith_esr(self, Q, get_object_or_404): eq_(views.get_release_or_404('45.0esr', 'Firefox'), get_object_or_404.return_value) Q.assert_any_call(product='Firefox') Q.assert_any_call(product='Firefox Extended Support Release')
def test_get_release_or_404_endswith_esr(self): rel = views.get_release_or_404('45.0esr', 'Firefox') assert rel.version == '45.0esr' assert rel.channel == 'ESR'
def test_get_release_or_404(self, Q, get_object_or_404): eq_(views.get_release_or_404('version', 'product'), get_object_or_404.return_value) get_object_or_404.assert_called_with( Release, Q.return_value, version='version') Q.assert_called_once_with(product='product')
def test_get_release_or_404(self, Q, get_object_or_404): eq_(views.get_release_or_404("version", "product"), get_object_or_404.return_value) get_object_or_404.assert_called_with(Release, Q.return_value, version="version") Q.assert_called_with(product="product")
def test_get_release_or_404_esr(self, Q, get_object_or_404): eq_(views.get_release_or_404("24.5.0", "Firefox"), get_object_or_404.return_value) Q.assert_any_call(product="Firefox") Q.assert_any_call(product="Firefox Extended Support Release") Q.__or__.assert_called()
def test_get_release_or_404_endswith_esr(self): rel = views.get_release_or_404('45.0esr', 'Firefox') eq_(rel.version, '45.0esr') eq_(rel.channel, 'ESR')