def test_check_in_use_failure(self): with pytest.raises( Exception ) as exc: # Wide catch, scope narrowed for preventing nested Exception override in_use = Redirect.check_in_use(shortcode='xxx') assert isinstance(exc.type, ShortcodeNotFound.__class__) # Sanity check
def test_check_in_use_true(self): assert Redirect.check_in_use(shortcode='090909')
def test_check_in_use_false(self): assert Redirect.check_in_use(shortcode='090909') is False