def test_unique_url(self): u = URL() u.url = 'http://www.test.com/' u.save() with pytest.raises(IntegrityError): u = URL() u.url = 'http://www.test.com/' u.save()
def test_hash(self): u = URL() u.url = 'http://www.test.com/' u.save() assert u.hash == '72f0bcee7e19e192abf3e36386ac8317'