Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed some bugs with formtools tests.

Without these checks, it is possible for the tests to pass by virtue of
asserts never being reached for some reason (very possible in this case, due
to handling of security hashes).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15198 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit cfcb591dd8d3f1ead78e0bdb9578852312768f97 1 parent a6b9dbc
Luke Plant authored January 13, 2011
6  django/contrib/formtools/tests/__init__.py
@@ -356,11 +356,13 @@ def test_14498(self):
356 356
         Regression test for ticket #14498.  All previous steps' forms should be
357 357
         validated.
358 358
         """
  359
+        reached = [False]
359 360
         that = self
360 361
 
361 362
         class WizardWithProcessStep(WizardClass):
362 363
             def process_step(self, request, form, step):
363 364
                 that.assertTrue(hasattr(form, 'cleaned_data'))
  365
+                reached[0] = True
364 366
 
365 367
         wizard = WizardWithProcessStep([WizardPageOneForm,
366 368
                                         WizardPageTwoForm,
@@ -370,6 +372,7 @@ def process_step(self, request, form, step):
370 372
                 "hash_0": "7e9cea465f6a10a6fb47fcea65cb9a76350c9a5c",
371 373
                 "wizard_step": "1"}
372 374
         wizard(DummyRequest(POST=data))
  375
+        self.assertTrue(reached[0])
373 376
 
374 377
     def test_14576(self):
375 378
         """
@@ -400,6 +403,7 @@ def test_15075(self):
400 403
         Regression test for ticket #15075.  Allow modifying wizard's form_list
401 404
         in process_step.
402 405
         """
  406
+        reached = [False]
403 407
         that = self
404 408
 
405 409
         class WizardWithProcessStep(WizardClass):
@@ -408,6 +412,7 @@ def process_step(self, request, form, step):
408 412
                     self.form_list[1] = WizardPageTwoAlternativeForm
409 413
                 if step == 1:
410 414
                     that.assertTrue(isinstance(form, WizardPageTwoAlternativeForm))
  415
+                    reached[0] = True
411 416
 
412 417
         wizard = WizardWithProcessStep([WizardPageOneForm,
413 418
                                         WizardPageTwoForm,
@@ -417,3 +422,4 @@ def process_step(self, request, form, step):
417 422
                 "hash_0": "7e9cea465f6a10a6fb47fcea65cb9a76350c9a5c",
418 423
                 "wizard_step": "1"}
419 424
         wizard(DummyRequest(POST=data))
  425
+        self.assertTrue(reached[0])

0 notes on commit cfcb591

Please sign in to comment.
Something went wrong with that request. Please try again.