 <p>There are couple of things you could do easily. First point is</p> <ul> <li><p>you could use <strong>Positive integer field</strong> in Django, if you want only positive integer in this model</p></li> <li><p>if you want to do the custom way, please raise an exception or use the assert statement for it. Then in the test case could check whether exception or assertion Error is raised </p></li> </ul>