##// END OF EJS Templates
Fixed the tests. Added exists() method for the post.
Fixed the tests. Added exists() method for the post.

File last commit:

r8:b62ef70f default
r8:b62ef70f default
Show More
tests.py
33 lines | 785 B | text/x-python | PythonLexer
from django.test import TestCase
import boards
from boards.models import Post
class BoardTests(TestCase):
def create_post(self):
return Post.objects.create_post(title = 'title',
text = 'text')
def test_post_add(self):
post = self.create_post()
self.assertIsNotNone(post)
self.assertEqual(boards.models.NO_PARENT, post.parent)
def test_delete_post(self):
post = self.create_post()
post_id = post.id
Post.objects.delete_post(post)
self.assertTrue(Post.objects.exists(post_id))
def test_delete_posts_by_ip(self):
post = self.create_post()
post_id = post.id
Post.objects.delete_posts_by_ip('0.0.0.0')
self.assertTrue(Post.objects.exists(post_id))