Ignore:
Timestamp:
6 Nov 2012, 12:23:05 (12 years ago)
Author:
Henrik Bettermann
Message:

Fix exporter test.

Show personal_updated on NigeriaStudentPersonalDisplayFormPage? like in base package.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py

    r9536 r9562  
    1919import shutil
    2020import tempfile
     21from datetime import datetime, timedelta
    2122from StringIO import StringIO
    2223from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo
     
    258259            'acc_let deleted'
    259260            in self.browser.contents)
     261
     262    def test_student_expired_personal_data(self):
     263        # Login
     264        delta = timedelta(days=180)
     265        self.student.personal_updated = datetime.utcnow() - delta
     266        self.browser.open(self.login_path)
     267        self.browser.getControl(name="form.login").value = self.student_id
     268        self.browser.getControl(name="form.password").value = 'spwd'
     269        self.browser.getControl("Login").click()
     270        self.assertEqual(self.browser.url, self.student_path)
     271        self.assertTrue(
     272            'You logged in' in self.browser.contents)
     273        # Students don't see personal_updated field in edit form
     274        self.browser.open(self.edit_personal_path)
     275        self.assertFalse('Updated' in self.browser.contents)
     276        self.browser.open(self.personal_path)
     277        self.assertTrue('Updated' in self.browser.contents)
     278        self.browser.getLink("Logout").click()
     279        delta = timedelta(days=181)
     280        self.student.personal_updated = datetime.utcnow() - delta
     281        self.browser.open(self.login_path)
     282        self.browser.getControl(name="form.login").value = self.student_id
     283        self.browser.getControl(name="form.password").value = 'spwd'
     284        self.browser.getControl("Login").click()
     285        self.assertEqual(self.browser.url, self.edit_personal_path)
     286        self.assertTrue(
     287            'Your personal data record expired' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.