Changeset 7912 for main


Ignore:
Timestamp:
19 Mar 2012, 01:55:47 (13 years ago)
Author:
uli
Message:
  • Make batched applicant setup an own test case for reimport in other tests.
  • Fix little typo.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py

    r7909 r7912  
    164164        shutil.rmtree(os.path.dirname(fin_file))
    165165
    166 class ApplicantImporterTest(FunctionalTestCase):
     166class ApplicantImportExportSetup(FunctionalTestCase):
    167167
    168168    layer = FunctionalLayer
    169169
    170170    def setUp(self):
    171         super(ApplicantImporterTest, self).setUp()
     171        super(ApplicantImportExportSetup, self).setUp()
    172172        # Setup a sample site for each test
    173173        app = University()
     
    204204        applicant = Applicant()
    205205        applicant.firstname = u'Anna'
    206         applicant.firstname = u'Tester'
     206        applicant.lastname = u'Tester'
    207207        self.app['applicants']['dp2011'].addApplicant(applicant)
    208208        self.application_number = applicant.application_number
    209209        self.applicant = self.app['applicants']['dp2011'][
    210210            self.application_number]
     211        self.workdir = tempfile.mkdtemp()
     212        return
     213
     214    def tearDown(self):
     215        super(ApplicantImportExportSetup, self).tearDown()
     216        shutil.rmtree(self.workdir)
     217        shutil.rmtree(self.dc_root)
     218        clearSite()
     219        return
     220
     221class ApplicantImporterTest(ApplicantImportExportSetup):
     222
     223    layer = FunctionalLayer
     224
     225    def setUp(self):
     226        super(ApplicantImporterTest, self).setUp()
    211227        self.importer = ApplicantImporter()
    212         self.workdir = tempfile.mkdtemp()
    213228        self.csv_file = os.path.join(self.workdir, 'sample_applicant_data.csv')
    214229        self.csv_file_faulty = os.path.join(self.workdir,
     
    219234        open(self.csv_file_faulty, 'wb').write(FAULTY_APPLICANT_SAMPLE_DATA)
    220235        open(self.csv_file_update, 'wb').write(APPLICANT_SAMPLE_DATA_UPDATE)
    221 
    222     def tearDown(self):
    223         super(ApplicantImporterTest, self).tearDown()
    224         shutil.rmtree(self.workdir)
    225         shutil.rmtree(self.dc_root)
    226         clearSite()
    227         return
    228236
    229237    def test_interface(self):
Note: See TracChangeset for help on using the changeset viewer.