<s> import re <EOL> from django import forms <EOL> from django . test import TestCase <EOL> class FormWizardWithNullBooleanField ( TestCase ) : <EOL> urls = '<STR_LIT>' <EOL> input_re = re . compile ( '<STR_LIT>' ) <EOL> wizard_url = '<STR_LIT>' <EOL> wizard_step_data = ( <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:2>' , <EOL> } , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> ) <EOL> def grabFieldData ( self , response ) : <EOL> """<STR_LIT>""" <EOL> previous_fields = response . context [ '<STR_LIT>' ] <EOL> fields = { '<STR_LIT>' : response . context [ '<STR_LIT>' ] } <EOL> def grab ( m ) : <EOL> fields [ m . group ( <NUM_LIT:1> ) ] = m . group ( <NUM_LIT:2> ) <EOL> return '<STR_LIT>' <EOL> self . input_re . sub ( grab , previous_fields ) <EOL> return fields <EOL> def checkWizardStep ( self , response , step_no ) : <EOL> """<STR_LIT>""" <EOL> step_count = len ( self . wizard_step_data ) <EOL> self . assertEqual ( response . status_code , <NUM_LIT:200> ) <EOL> self . assertContains ( response , '<STR_LIT>' % ( step_no , step_count ) ) <EOL> data = self . grabFieldData ( response ) <EOL> data . update ( self . wizard_step_data [ step_no - <NUM_LIT:1> ] ) <EOL> return self . client . post ( self . wizard_url , data ) <EOL> def testWizard ( self ) : <EOL> response = self . client . get ( self . wizard_url ) <EOL> for step_no in range ( <NUM_LIT:1> , len ( self . wizard_step_data ) + <NUM_LIT:1> ) : <EOL> response = self . checkWizardStep ( response , step_no ) </s>
