From 1ea2ebbb22ccee75547904ad0c8470e4ee4df5b2 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 4 Dec 2010 07:28:12 +0000 Subject: [PATCH] Removed all usages of deprecated TestCase methods (self.fail*). This removed most of the Warnings emitted (with -Wall) during the test suite. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14803 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- formtools/tests/__init__.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/formtools/tests/__init__.py b/formtools/tests/__init__.py index 6aeeaf5..b88f565 100644 --- a/formtools/tests/__init__.py +++ b/formtools/tests/__init__.py @@ -1,14 +1,13 @@ import os -from django import forms -from django import http +from django import forms, http from django.conf import settings from django.contrib.formtools import preview, wizard, utils from django.test import TestCase from django.utils import unittest -success_string = "Done was called!" +success_string = "Done was called!" class TestFormPreview(preview.FormPreview): def get_context(self, request, form): @@ -100,7 +99,7 @@ class PreviewTests(TestCase): # show we previously saw first stage of the form. self.test_data.update({'stage':2}) response = self.client.post('/test1/', self.test_data) - self.failIfEqual(response.content, success_string) + self.assertNotEqual(response.content, success_string) hash = self.preview.security_hash(None, TestForm(self.test_data)) self.test_data.update({'hash': hash}) response = self.client.post('/test1/', self.test_data) @@ -134,7 +133,7 @@ class PreviewTests(TestCase): # show we previously saw first stage of the form. self.test_data.update({'stage':2}) response = self.client.post('/test1/', self.test_data) - self.failIfEqual(response.content, success_string) + self.assertNotEqual(response.content, success_string) hash = utils.security_hash(None, TestForm(self.test_data)) self.test_data.update({'hash': hash}) response = self.client.post('/test1/', self.test_data) @@ -151,11 +150,11 @@ class PreviewTests(TestCase): self.test_data.update({'stage':2}) response = self.client.post('/test2/', self.test_data) self.assertEqual(response.status_code, 200) - self.failIfEqual(response.content, success_string) + self.assertNotEqual(response.content, success_string) hash = utils.security_hash(None, TestForm(self.test_data)) self.test_data.update({'hash': hash}) response = self.client.post('/test2/', self.test_data) - self.failIfEqual(response.content, success_string) + self.assertNotEqual(response.content, success_string) class SecurityHashTests(unittest.TestCase): @@ -392,4 +391,3 @@ class WizardTests(TestCase): "wizard_step": "1"} wizard(DummyRequest(POST=data)) self.assertTrue(reached[0]) -