# HG changeset patch # User neko259 # Date 2013-11-09 19:56:34 # Node ID ccd7caf63eb12ccb67d9b001ad2dd4f0faeceb4f # Parent e7cf289d8fe7afec9245185187add8ad93a1b030 Use django's test case that works with database correctry without the need to flush transactions manually. Removed some workarounds that were used before diff --git a/boards/tests.py b/boards/tests.py --- a/boards/tests.py +++ b/boards/tests.py @@ -1,5 +1,5 @@ # coding=utf-8 -from django.utils.unittest import TestCase +from django.test import TestCase from django.test.client import Client import time @@ -47,8 +47,6 @@ class BoardTests(TestCase): self.assertFalse(Post.objects.exists(post_id)) - # Authentication tests - def test_get_thread(self): opening_post = self._create_post() @@ -92,8 +90,6 @@ class BoardTests(TestCase): captcha_enabled = settings.ENABLE_CAPTCHA settings.ENABLE_CAPTCHA = False - Post.objects.all().delete() - client = Client() valid_tags = u'tag1 tag_2 тег_3' @@ -136,9 +132,6 @@ class BoardTests(TestCase): def test_404(self): """Test receiving error 404 when opening a non-existent page""" - Post.objects.all().delete() - Tag.objects.all().delete() - tag_name = u'test_tag' tag = Tag.objects.create(name=tag_name) client = Client()