コード例 #1
0
 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
コード例 #2
0
 def test_check_in_use_true(self):
     assert Redirect.check_in_use(shortcode='090909')
コード例 #3
0
 def test_check_in_use_false(self):
     assert Redirect.check_in_use(shortcode='090909') is False