Ignore:
Timestamp:
30 Apr 2014, 14:17:47 (11 years ago)
Author:
Henrik Bettermann
Message:

Add viewlets for left thumb fingerprint minutiae file uploads.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r11553 r11611  
    3636from waeup.uniben.testing import FunctionalLayer
    3737
     38SAMPLE_FPM = os.path.join(os.path.dirname(__file__), 'sample.fpm')
    3839
    3940class StudentUITests(StudentsFullSetup):
     
    745746        self.assertTrue('zope.mgr - waeup.uniben.students.browser.CustomStudentActivatePage - '
    746747                        'B1000000 - account activated' in logcontent)
     748
     749    def test_manage_upload_fpm_file(self):
     750        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     751        self.browser.open(self.manage_clearance_path)
     752        image = open(SAMPLE_FPM, 'rb')
     753        ctrl = self.browser.getControl(name='leftthumbprintupload')
     754        file_ctrl = ctrl.mech_control
     755        file_ctrl.add_file(image, filename='thumbprint.fpm')
     756        self.browser.getControl(
     757            name='upload_leftthumbprintupload').click()
     758        self.assertTrue(
     759            'File finger1.fpm uploaded.' in self.browser.contents)
     760        self.assertTrue(
     761            'http://localhost/app/students/B1000000/finger1.fpm'
     762            in self.browser.contents)
     763        self.browser.getControl(
     764            name='delete_leftthumbprintupload').click()
     765        self.assertTrue(
     766            'finger1.fpm deleted'
     767            in self.browser.contents)
  • main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py

    r11556 r11611  
    107107    download_name = u'secr_cults'
    108108
    109 class ResultStatementImage(Image):
     109class SecrCultsStatementImage(Image):
    110110    """Renders Affidavit of Non-Membership of Secret Cults scan.
    111111    """
    112112    grok.name('secr_cults')
    113113    download_name = u'secr_cults'
     114
     115# Fingerprints
     116
     117class LeftThumbPrintDisplay(FileDisplay):
     118    """Left thumb fingerprint display viewlet.
     119    """
     120    grok.order(21)
     121    label = _(u'Left Thumb Fingerprint')
     122    title = _(u'Left Thumb Fingerprint Minutiae')
     123    download_name = u'finger1.fpm'
     124
     125class LeftThumbPrintSlip(LeftThumbPrintDisplay):
     126    """Mentions scanned fingerprint on slip.
     127
     128    Fingerprint minutiae is not printet.
     129    """
     130    grok.view(ExportPDFClearanceSlipPage)
     131
     132class LeftThumbPrintUpload(FileUpload):
     133    """Left thumb fingerprint upload viewlet.
     134    """
     135    grok.order(21)
     136    label = _(u'Left Thumb Fingerprint')
     137    title = _(u'Left Thumb Fingerprint Minutiae')
     138    mus = 1024 * 5
     139    download_name = u'finger1.fpm'
     140
     141class LeftThumbPrintImage(Image):
     142    """Renders left thumb fingerprint minutiae for download.
     143    """
     144    grok.name('finger1.fpm')
     145    download_name = u'finger1.fpm'
Note: See TracChangeset for help on using the changeset viewer.