Ignore:
Timestamp:
28 May 2014, 14:33:27 (11 years ago)
Author:
uli
Message:

Make sure already existing fingerprints are overridden.

File:
1 edited

Legend:

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

    r11674 r11675  
    438438        self.assertEqual(stored_file.read(), 'FP1faked_fpm')
    439439
     440    def test_put_student_fingerprints_existing(self):
     441        # existing fingerprints are overwritten
     442        server = ServerProxy('http://mgr:mgrpw@localhost/app')
     443        self.setup_student(self.student)
     444        self.create_fpm_file(self.student, '1')
     445        fpm1 = xmlrpclib.Binary('FP1faked_fpm1')
     446        fpm2 = xmlrpclib.Binary('FP1faked_fpm2')
     447        result = server.put_student_fingerprints(
     448            self.student.student_id, {'1': fpm1, '3': fpm2})
     449        self.assertEqual(result, True)
     450        stored_file1 = getUtility(IExtFileStore).getFileByContext(
     451            self.student, attr="1.fpm")
     452        stored_file2 = getUtility(IExtFileStore).getFileByContext(
     453            self.student, attr="3.fpm")
     454        self.assertEqual(stored_file1.read(), 'FP1faked_fpm1')
     455        self.assertEqual(stored_file2.read(), 'FP1faked_fpm2')
     456
    440457    def test_get_student_fingerprints_no_stud(self):
    441458        # invalid student ids result in empty dict
Note: See TracChangeset for help on using the changeset viewer.