def test_11(self, m="Validated Post should be able to save"): p = Post({"title": "This is the test", "contents":"This is the content", "tags":"music,guitar,test", "author":"*****@*****.**"}) p.validate() p.is_valid() |should| equal_to(True) len(p.errors()) |should| equal_to(0) p.save() |should_not| throw(ModelNotValid)
def test_06(self, m="Post should validate"): p = Post({"title": "This is the test", "contents":"This is the content", "tags":"music,guitar,test", "author":"*****@*****.**"}) p.validate() p.is_valid() |should| equal_to(True) len(p.errors()) |should| equal_to(0)
def test_01(self, m="Post should not validate without title, contents, tags and author"): p = Post({"title": "", "contents":"", "tags":"", "author":""}) p.validate() p.is_valid() |should| equal_to(False) len(p.errors()) |should| equal_to(4)
def test_05(self, m="Post should not validate without author email"): p = Post({"title": "This is the test", "contents":"This is the content", "tags":"music,guitar,test", "author":"yanekk"}) p.validate() p.is_valid() |should| equal_to(False) len(p.errors()) |should| equal_to(1)