Ignore:
Timestamp:
3 Jul 2012, 10:41:09 (13 years ago)
Author:
Henrik Bettermann
Message:

Add tests for delEntry.

File:
1 edited

Legend:

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

    r8884 r8886  
    825825            self.app) is self.student['payments']['p120']
    826826
     827    def test_delEntry(self):
     828        assert self.processor.getEntry(
     829            dict(student_id=self.student.student_id, p_id='p120'),
     830            self.app) is self.student['payments']['p120']
     831        self.assertEqual(len(self.student['payments'].keys()),1)
     832        self.processor.delEntry(
     833            dict(student_id=self.student.student_id, p_id='p120'),
     834            self.app)
     835        assert self.processor.getEntry(
     836            dict(student_id=self.student.student_id, p_id='p120'),
     837            self.app) is None
     838        self.assertEqual(len(self.student['payments'].keys()),0)
     839
    827840    def test_addEntry(self):
    828841        self.assertEqual(len(self.student['payments'].keys()),1)
     
    870883        self.assertEqual(str(payment.creation_date.tzinfo),'UTC')
    871884        shutil.rmtree(os.path.dirname(fin_file))
    872 
    873885        logcontent = open(self.logfile).read()
    874         # Logging message from updateEntry,
     886        # Logging message from updateEntry
    875887        self.assertTrue(
    876888            'INFO - system - K1000001 - Payment ticket updated: '
     
    891903        self.assertEqual(num_warns,0)
    892904        shutil.rmtree(os.path.dirname(fin_file))
     905
     906    def test_import_remove(self):
     907        num, num_warns, fin_file, fail_file = self.processor.doImport(
     908            self.csv_file, PAYMENT_HEADER_FIELDS,'create')
     909        num, num_warns, fin_file, fail_file = self.processor.doImport(
     910            self.csv_file, PAYMENT_HEADER_FIELDS,'remove')
     911        self.assertEqual(num_warns,0)
     912        shutil.rmtree(os.path.dirname(fin_file))
     913        logcontent = open(self.logfile).read()
     914        self.assertTrue(
     915            'INFO - system - K1000001 - Payment ticket removed: p1266236341955'
     916            in logcontent)
    893917
    894918    def test_import_wo_pid(self):
Note: See TracChangeset for help on using the changeset viewer.