Ignore:
Timestamp:
20 Sep 2018, 20:40:45 (6 years ago)
Author:
Henrik Bettermann
Message:

Extend tests.

Location:
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/browser.py

    r15158 r15159  
    11631163            'validate_transcript')
    11641164        self.flash(_('Transcript validated.'))
    1165         self.redirect(self.url(self.context))
     1165        self.redirect(self.url(self.context) + '/transcript')
    11661166        return
    11671167
     
    11871187            self.flash(_('You have already signed this transcript.'),
    11881188                type="warning")
    1189             self.redirect(self.url(self.context))
     1189            self.redirect(self.url(self.context) + '/transcript')
    11901190            return
    11911191        self.flash(_('Transcript signed.'))
     
    12441244        tz = getattr(queryUtility(IKofaUtils), 'tzinfo', pytz.utc)
    12451245        today = now(tz).strftime('%d/%m/%Y %H:%M:%S %Z')
    1246         old_transcript_comment = self.context.transcript_comment
     1246        old_transcript_comment = getattr(
     1247            self.context, 'transcript_comment', None)
    12471248        if old_transcript_comment == None:
    12481249            old_transcript_comment = ''
  • main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/tests/test_browser.py

    r15157 r15159  
    22892289            'http://localhost/app/students/K1000000/studycourse/transcript'
    22902290            in self.browser.contents)
     2291        self.browser.getLink("Anna Tester").click()
     2292        self.assertTrue(
     2293            'Anna Tester: Transcript Data' in self.browser.contents)
     2294        # Officer is on transcript page and can validate the transcript
     2295        self.browser.getLink("Validate transcript").click()
     2296        self.assertTrue(
     2297            '<div class="alert alert-success">Transcript validated.</div>'
     2298            in self.browser.contents)
     2299        # Officer is still on transcript page and can release the transcript
     2300        self.browser.getLink("Release transcript").click()
     2301        self.browser.getControl("Save comment and release transcript").click()
     2302        self.assertTrue(
     2303            '<div class="alert alert-success">'
     2304            'Transcript released and final transcript file saved.</div>'
     2305            in self.browser.contents)
    22912306
    22922307    def test_landingpage_transcript_signee(self):
     
    23132328        self.assertTrue(
    23142329            'http://localhost/app/students/K1000000/studycourse/transcript'
     2330            in self.browser.contents)
     2331        self.browser.getLink("Anna Tester").click()
     2332        self.assertTrue(
     2333            'Anna Tester: Transcript Data' in self.browser.contents)
     2334        # Officer is on transcript page and can sign the transcript
     2335        self.browser.getLink("Sign transcript").click()
     2336        self.assertTrue(
     2337            '<div class="alert alert-success">Transcript signed.</div>'
     2338            in self.browser.contents)
     2339        # Officer is still on transcript page
     2340        self.assertTrue(
     2341            'Anna Tester: Transcript Data' in self.browser.contents)
     2342        # Officer can sign the transcript only once
     2343        self.browser.getLink("Sign transcript").click()
     2344        self.assertTrue(
     2345            '<div class="alert alert-warning">'
     2346            'You have already signed this transcript.</div>'
     2347            in self.browser.contents)
     2348        # Signature can be seen on transcript page
     2349        self.assertTrue(
     2350            'Electronically signed by Ruth Gordon (mrtranscript) on'
    23152351            in self.browser.contents)
    23162352
Note: See TracChangeset for help on using the changeset viewer.