Ignore:
Timestamp:
26 Apr 2011, 10:44:43 (14 years ago)
Author:
Henrik Bettermann
Message:

Fix tests.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/batchprocessing.txt

    r5947 r5978  
    286286    >>> open('certificates.csv', 'wb').write(
    287287    ... """code,faculty_code,department_code,title,study_mode,start_level,end_level,application_category
    288     ... CERT1,FAC1,DEP1,Certificate 1,uf_ft,100,30,basic
    289     ... CERT2,FAC1,DEP1,Certificate 2,uf_ft,200,30,cest
     288    ... CERT1,FAC1,DEP1,Certificate 1,uf_ft,100,300,basic
     289    ... CERT2,FAC1,DEP1,Certificate 2,uf_ft,200,300,cest
    290290    ... """)
    291291
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt

    r5954 r5978  
    485485
    486486  >>> browser.getControl(name='form.study_mode').value = 'combined'
    487   >>> browser.getControl(name='form.start_level').value = '100'
    488   >>> browser.getControl(name='form.end_level').value = '400'
     487  >>> browser.getControl(name='form.start_level').value = ['100']
     488  >>> browser.getControl(name='form.end_level').value = ['400']
    489489  >>> browser.getControl(name='form.application_category').value = 'UME'
    490490
     
    501501  >>> browser.getControl(name='form.code').value = 'CERT1'
    502502  >>> browser.getControl(name='form.study_mode').value = 'combined'
    503   >>> browser.getControl(name='form.start_level').value = '100'
    504   >>> browser.getControl(name='form.end_level').value = '400'
     503  >>> browser.getControl(name='form.start_level').value = ['100']
     504  >>> browser.getControl(name='form.end_level').value = ['400']
    505505  >>> browser.getControl(name='form.application_category').value = 'UME'
    506506
     
    596596
    597597Once we have a certificate, we can add also certificate courses. These
    598 are references to courses with some extra data.
     598are referrers of courses with some extra data.
    599599
    600600Before we can work with certificate courses, we need some certificates
     
    621621  >>> browser.getControl(name='form.title').value = 'Certificate 1'
    622622  >>> browser.getControl(name='form.study_mode').value = 'combined'
    623   >>> browser.getControl(name='form.start_level').value = '100'
    624   >>> browser.getControl(name='form.end_level').value = '400'
     623  >>> browser.getControl(name='form.start_level').value = ['100']
     624  >>> browser.getControl(name='form.end_level').value = ['400']
    625625  >>> browser.getControl(name='form.application_category').value = 'UME'
    626626  >>> browser.getControl('Add certificate').click()
     
    632632  >>> browser.getControl(name='form.title').value = 'Certificate 2'
    633633  >>> browser.getControl(name='form.study_mode').value = 'combined'
    634   >>> browser.getControl(name='form.start_level').value = '100'
    635   >>> browser.getControl(name='form.end_level').value = '400'
     634  >>> browser.getControl(name='form.start_level').value = ['100']
     635  >>> browser.getControl(name='form.end_level').value = ['400']
    636636  >>> browser.getControl(name='form.application_category').value = 'UME'
    637637  >>> browser.getControl('Add certificate').click()
     
    644644with their code as key.
    645645
    646 Each certificate provides a ``Add course`` action button near top.
     646Each certificate provides a ``Add course referrer`` action button near top.
    647647
    648648Certificates provide an add-form to add new certcourses:
     
    666666
    667667  >>> ctrl.getControl('COURSE1').selected = True
    668   >>> browser.getControl('Add course').click()
     668  >>> browser.getControl(name='form.level').value = ['100'] 
     669  >>> browser.getControl('Add course referrer').click()
    669670
    670671Our certificatecourse will be linked on the parent certificate page:
    671672
    672673  >>> browser.open(cert_url)
    673   >>> browser.getLink('COURSE1').click()
     674  >>> browser.getLink('COURSE1_100').click()
    674675  >>> browser.url
    675676  'http://localhost/my...sity/faculties/TF/TD/certificates/CERT1/COURSE1_100'
     
    692693
    693694  >>> browser.open(cert_url + '/COURSE1_100')
    694   >>> browser.getLink('Edit course reference').click()
     695  >>> browser.getLink('Edit course referrer').click()
    695696
    696697Let's set a new level (it was 100 before) and save the form. This will
    697698bring us to the certificate index page afterwards:
    698699
    699   >>> browser.getControl(name='form.level').value = "200"
     700  >>> browser.getControl(name='form.level').value = ['200']     
    700701  >>> ctrl = browser.getControl("Save and return")
    701702  >>> ctrl.click()
     
    703704As we changed the level, also the URL will change:
    704705
    705   >>> browser.getLink('COURSE1').click()
     706  >>> browser.getLink('COURSE1_200').click()
    706707  >>> browser.url
    707708  'http://localhost/myun.../TF/TD/certificates/CERT1/COURSE1_200'
     
    710711changed:
    711712
    712   >>> browser.getLink('Edit course reference').click()
    713   >>> browser.getControl(name='form.level').value = "666"
     713  >>> browser.getLink('Edit course referrer').click()
     714  >>> browser.getControl(name='form.level').value = ['400']
    714715  >>> browser.getControl('Cancel').click()
    715716
    716 Our certcourse provides a new level of 200 and not 666:
     717Our certcourse provides a new level of 200 and not 400:
    717718
    718719  >>> browser.open(cert_url + '/COURSE1_200')
  • main/waeup.sirp/trunk/src/waeup/sirp/university/api.txt

    r4975 r5978  
    2222   facultycontainer.txt
    2323
    24 Additional infos about the references to courses and how they are
     24Additional infos about the referrers of courses and how they are
    2525handled can be found in:
    2626
  • main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.txt

    r5949 r5978  
    9898   .. method:: addCourseRef(course[, level=100,[ core_or_elective=True]])
    9999
    100       Add a reference to a course. A course is an object implementing
     100      Add a referrer of a course. A course is an object implementing
    101101      :class:`waeup.sirp.interfaces.ICourse`.
    102102
    103       Please don't be confused by the term 'reference'. This just
    104       means an ordinary :class:`waeup.sirp.university.course.Course` object
    105       in almost all cases. As this object will normaly be one stored
    106       in a department, the course here will simply become a reference
    107       to the 'real' one in the department container.
     103      Please don't be confused by the term 'referrer'. As course objects
     104      will normaly be  stored
     105      in a department, the course referrer refers to
     106      the 'real' course in the department container.
    108107
    109108   .. method:: delCourseRef(code)
    110109
    111       Remove a course from a certificate.
    112 
    113       The course must be given by its code number.
     110      Remove a course referrer from a certificate.
     111
     112      The referrer must be given by its code number.
    114113
    115114:class:`CertificateCourse`
     
    118117.. class:: CertificateCourse(course[, level=100[, core_or_elective=True]])
    119118
    120    Create a certificate course.
    121 
    122    A certificate-course is a course (:class:`Course`) which is part of
    123    a certificate. Normally, certificate-courses are held in
     119   Create a course referrer.
     120
     121   A certificate course (old term) or course referrer are held in
    124122   certificates and refer to an existing :class:`Course` instance held
    125123   elsewhere.
    126124
    127    A certificate can require several courses and one
    128    course can be required by several certificates.
     125   A certificate can require several course referrers and one
     126   course referrer can be required by several certificates.
    129127
    130128   .. attribute:: course
     
    223221   instance is removed from a container.
    224222
    225    Tries to remove all referencing :class:`CertificateCourse`
    226    instances that reference the removed course.
     223   Tries to remove all referring :class:`CertificateCourse`
     224   instances that refer to a removed course.
    227225
    228226   To accomplish that, the parents of the removed course are looked up
    229    for a certifcate container which contains a certificate-course that
    230    contains a reference to the deleted course.
     227   for a certifcate container which contains a course referrer that
     228   refers to the deleted course.
    231229
    232230   .. seealso:: :ref:`removecertificatecourses`
     
    290288
    291289If a certificate course requires a certain course and this is course
    292 is deleted, also the referencing certificate course is deleted.
     290is deleted, also the referring certificate course is deleted.
    293291
    294292We setup a data structure that reflects typical usage. It looks like
     
    356354    ['mydept']
    357355
    358 The certificate-course we stored in the certificate is indeed a
    359 reference to the course, not a copy of it:
     356The course referrer we stored in the certificate is indeed a
     357referrer of the course, not a copy of it:
    360358
    361359    >>> course = newdbroot['mydept'].courses['MYCOURSE']
  • main/waeup.sirp/trunk/src/waeup/sirp/university/courserefs.txt

    r4921 r5978  
    1 Course references
    2 *****************
     1Course referrers
     2****************
    33
    4 Courses are referenced by certificate courses.
     4Courses are referred to by certificate courses.
    55
    66:Test-Layer: functional
    77
    8 We can be sure, that when removing courses or references to them,
     8We can be sure, that when removing courses or referrers of them,
    99other data will be handled in a way we expect. That is,
    1010
    11 * when we remove a course, we want all references to it be removed as
     11* when we remove a course, we want all referrers to it be removed as
    1212  well
    1313
    14 * when we remove a reference to a course, nothing else should be
    15   touched but only this very reference.
     14* when we remove a referrer of a course, nothing else should be
     15  touched but only this very referrer.
    1616
    1717
    18 As correct deletion of references needs support of catalogs (we lookup
    19 catalogs to find references), we need a fully blown ZODB here,
     18As correct deletion of referrer needs support of catalogs (we lookup
     19catalogs to find referrers), we need a fully blown ZODB here,
    2020including an instance of :class:`waeup.sirp.app.University`, as this is our
    2121`ISite` object where the catalogs are stored.
     
    5959    >>> fac['DEPT2'].courses.addCourse(course)
    6060
    61 Finally, we add a certificate with references (certificate courses) to
     61Finally, we add a certificate with referrers (certificate courses) to
    6262the created courses:
    6363
     
    7777    ...   fac['DEPT2'].courses['CRS2'], level=200)
    7878
    79 So, we have three references in our certificate to two different
     79So, we have three referrers in our certificate of two different
    8080courses stored somewhere in the application:
    8181
     
    8383    [u'CRS1_100', u'CRS2_100', u'CRS2_200']
    8484
    85 Both, the courses themselves and the references to them, are the same
     85Both, the courses themselves and the referrers of them, are the same
    8686(not only equal):
    8787
     
    9292    True
    9393
    94 If we remove the course, also the reference to it in the cert course
     94If we remove the course, also the select item in the certificate course
    9595will be gone:
    9696
     
    108108    []
    109109
    110 If we remove a reference, this will not touch the referenced course
    111 nor other references:
     110If we remove a referrer of a course, this will not touch the course
     111nor other referrers:
    112112
    113113    >>> del fac['DEPT'].certificates['CERT']['CRS2_200']
Note: See TracChangeset for help on using the changeset viewer.