Ignore:
Timestamp:
11 Jun 2012, 07:07:52 (12 years ago)
Author:
Henrik Bettermann
Message:

See waeup.uniben.

Disable watermark.

Location:
main/waeup.futminna/trunk/src/waeup/futminna
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.futminna/trunk/src/waeup/futminna/applicants/applicant.py

    r8619 r8670  
    3030    grok.provides(ICustomApplicant)
    3131
     32    create_names = Applicant.create_names + [
     33        'lga', 'nationality', 'perm_address']
     34
    3235# Set all attributes of Applicant required in IApplicant as field
    3336# properties. Doing this, we do not have to set initial attributes
  • main/waeup.futminna/trunk/src/waeup/futminna/applicants/tests.py

    r8625 r8670  
    2020import tempfile
    2121import datetime
     22import grok
     23import pytz
     24from zope.event import notify
    2225from zope.intid.interfaces import IIntIds
    2326from zope.interface.verify import verifyClass, verifyObject
     
    2629from zope.catalog.interfaces import ICatalog
    2730from zope.testbrowser.testing import Browser
     31from hurry.workflow.interfaces import IWorkflowState
    2832from waeup.kofa.app import University
    2933from waeup.kofa.university.faculty import Faculty
     
    7983        self.app['applicants']['app2011'] = self.ugcontainer
    8084
     85        self.ugcontainer.mode = 'update'
     86        delta = datetime.timedelta(days=10)
     87        self.ugcontainer.startdate = datetime.datetime.now(pytz.utc) - delta
     88        self.ugcontainer.enddate = datetime.datetime.now(pytz.utc) + delta
     89
    8190        # Populate university
    8291        self.certificate = createObject('waeup.Certificate')
     
    8594        self.certificate.start_level = 100
    8695        self.certificate.end_level = 500
     96        self.certificate.study_mode = u'ug_ft'
    8797        self.app['faculties']['fac1'] = Faculty()
    8898        self.app['faculties']['fac1']['dep1'] = Department()
     
    94104        self.certificate2.start_level = 100
    95105        self.certificate2.end_level = 500
     106        self.certificate.study_mode = u'pg_ft'
    96107        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
    97108            self.certificate2)
     
    133144        self.browser.getControl(name="form.date_of_birth").value = '09/09/1988'
    134145        self.browser.getControl(name="form.lga").value = ['foreigner']
     146        self.browser.getControl(name="form.nationality").value = ['NG']
    135147        self.browser.getControl(name="form.sex").value = ['m']
    136148        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
     
    216228        self.assertEqual(payment.p_category,'application')
    217229        self.assertEqual(payment.amount_auth, 300.0)
     230        return
     231
     232    def test_create_ugstudent(self):
     233        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     234        manage_path = 'http://localhost/app/applicants/%s/%s/%s' % (
     235            'app2011', self.ugapplicant.application_number, 'manage')
     236        self.browser.open(manage_path)
     237        self.fill_correct_values()
     238        self.browser.getControl("Save").click()
     239        IWorkflowState(self.ugapplicant).setState('admitted')
     240        self.browser.getControl(name="form.course1").value = ['CERT1']
     241        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
     242        self.browser.getControl("Save").click()
     243        self.browser.getLink("Create student").click()
     244        student_id =  self.app['students'].keys()[0]
     245        self.assertTrue(('Student %s created' % student_id)
     246            in self.browser.contents)
     247        student = self.app['students'][student_id]
     248        self.assertEqual(student.email, 'xx@yy.zz')
     249        self.assertEqual(student.firstname, 'John')
     250        self.assertEqual(student.lastname, 'Tester')
     251        # Also additional attributes have been copied.
     252        self.assertEqual(student.lga, 'foreigner')
     253        self.assertEqual(student.nationality, 'NG')
    218254        return
    219255
  • main/waeup.futminna/trunk/src/waeup/futminna/browser/pdf.py

    r8204 r8670  
    2727    """
    2828
    29     header_logo_path = os.path.join(
    30         os.path.dirname(__file__), 'static', 'pdf_logo.jpg')
    31     watermark_path = os.path.join(
    32         os.path.dirname(__file__), 'static', 'pdf_watermark.jpg')
     29    #header_logo_path = os.path.join(
     30    #    os.path.dirname(__file__), 'static', 'pdf_logo.jpg')
     31    #watermark_path = os.path.join(
     32    #    os.path.dirname(__file__), 'static', 'pdf_watermark.jpg')
    3333
    34     watermark_pos = [-25, 100]
    35     logo_pos = [507, 720, 40]
     34    #watermark_pos = [-25, 100]
     35    #logo_pos = [507, 720, 40]
Note: See TracChangeset for help on using the changeset viewer.