Changeset 8863


Ignore:
Timestamp:
1 Jul 2012, 12:31:04 (12 years ago)
Author:
Henrik Bettermann
Message:

Rename all classes from CustomXYZ to NigeriaXYZ.

Customize PhoneWidget? for Nigeria here.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria
Files:
3 added
12 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/configure.zcml

    r8816 r8863  
    77  <include package="kofacustom.nigeria" file="locales.zcml" />
    88  <include package="grok" />
    9   <includeOverrides package="." file="overrides.zcml" />
     9  <includeOverrides package="kofacustom.nigeria" file="overrides.zcml" />
    1010</configure>
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/overrides.zcml

    r8813 r8863  
    55
    66  <!-- Register edit widget for PhoneNumbers -->
    7   <!-- adapter
     7  <adapter
    88      for="waeup.kofa.schema.interfaces.IPhoneNumber
    99           zope.publisher.interfaces.browser.IBrowserRequest"
    1010      provides="zope.formlib.interfaces.ISimpleInputWidget"
    11       factory="waeup.uniben.widgets.phonewidget.CustomPhoneWidget"
     11      factory="kofacustom.nigeria.widgets.phonewidget.NigeriaPhoneWidget"
    1212      permission="zope.Public"
    13       / -->
     13      />
    1414
    1515</configure>
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/payments/interfaces.py

    r8862 r8863  
    2121from kofacustom.nigeria.interfaces import MessageFactory as _
    2222
    23 class ICustomOnlinePayment(IPayment):
     23class INigeriaOnlinePayment(IPayment):
    2424    """A payment via payment gateways.
    2525
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/batching.py

    r8862 r8863  
    2525"""
    2626from kofacustom.nigeria.students.interfaces import (
    27     ICustomStudent, ICustomStudentUpdateByRegNo,
    28     ICustomStudentUpdateByMatricNo
     27    INigeriaStudent, INigeriaStudentUpdateByRegNo,
     28    INigeriaStudentUpdateByMatricNo
    2929    )
    3030from waeup.kofa.students.batching import StudentProcessor
    3131
    32 class CustomStudentProcessor(StudentProcessor):
     32class NigeriaStudentProcessor(StudentProcessor):
    3333    """A batch processor for IStudent objects.
    3434    """
    35     iface = ICustomStudent
    36     iface_byregnumber = ICustomStudentUpdateByRegNo
    37     iface_bymatricnumber = ICustomStudentUpdateByMatricNo
     35    iface = INigeriaStudent
     36    iface_byregnumber = INigeriaStudentUpdateByRegNo
     37    iface_bymatricnumber = INigeriaStudentUpdateByMatricNo
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py

    r8862 r8863  
    3535    PaymentReceiptActionButton, StudentPassportActionButton)
    3636from kofacustom.nigeria.students.interfaces import (
    37     ICustomStudentBase, ICustomStudent, ICustomStudentPersonal,
    38     ICustomUGStudentClearance,ICustomPGStudentClearance,
    39     ICustomStudentOnlinePayment,
     37    INigeriaStudentBase, INigeriaStudent, INigeriaStudentPersonal,
     38    INigeriaUGStudentClearance,INigeriaPGStudentClearance,
     39    INigeriaStudentOnlinePayment,
    4040    )
    4141from waeup.kofa.students.workflow import ADMITTED
    4242from kofacustom.nigeria.interfaces import MessageFactory as _
    4343
    44 class CustomOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb):
     44class NigeriaOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb):
    4545    """A breadcrumb for payments.
    4646    """
    47     grok.context(ICustomStudentOnlinePayment)
     47    grok.context(INigeriaStudentOnlinePayment)
    4848
    4949class PaymentReceiptActionButton(PaymentReceiptActionButton):
    5050    grok.order(4)
    51     grok.context(ICustomStudentOnlinePayment)
    52 
    53 class CustomStudentBaseManageFormPage(StudentBaseManageFormPage):
     51    grok.context(INigeriaStudentOnlinePayment)
     52
     53class NigeriaStudentBaseManageFormPage(StudentBaseManageFormPage):
    5454    """ View to manage student base data
    5555    """
    56     form_fields = grok.AutoFields(ICustomStudentBase).omit('student_id')
    57 
    58 class CustomStudentBaseEditFormPage(StudentBaseEditFormPage):
     56    form_fields = grok.AutoFields(INigeriaStudentBase).omit('student_id')
     57
     58class NigeriaStudentBaseEditFormPage(StudentBaseEditFormPage):
    5959    """ View to edit student base data
    6060    """
    61     form_fields = grok.AutoFields(ICustomStudentBase).select(
     61    form_fields = grok.AutoFields(INigeriaStudentBase).select(
    6262        'email', 'phone')
    6363
    6464
    65 class CustomStudentPersonalDisplayFormPage(StudentPersonalDisplayFormPage):
     65class NigeriaStudentPersonalDisplayFormPage(StudentPersonalDisplayFormPage):
    6666    """ Page to display student personal data
    6767    """
    68     grok.context(ICustomStudent)
    69     form_fields = grok.AutoFields(ICustomStudentPersonal)
     68    grok.context(INigeriaStudent)
     69    form_fields = grok.AutoFields(INigeriaStudentPersonal)
    7070    form_fields['perm_address'].custom_widget = BytesDisplayWidget
    7171
    7272
    73 class CustomStudentPersonalEditFormPage(StudentPersonalEditFormPage):
     73class NigeriaStudentPersonalEditFormPage(StudentPersonalEditFormPage):
    7474    """ Page to edit personal data
    7575    """
    76     form_fields = grok.AutoFields(ICustomStudentPersonal)
    77 
    78 
    79 class CustomStudentClearanceDisplayFormPage(StudentClearanceDisplayFormPage):
     76    form_fields = grok.AutoFields(INigeriaStudentPersonal)
     77
     78
     79class NigeriaStudentClearanceDisplayFormPage(StudentClearanceDisplayFormPage):
    8080    """ Page to display student clearance data
    8181    """
    82     grok.context(ICustomStudent)
    83 
    84     @property
    85     def form_fields(self):
    86         cm = getattr(self.context,'current_mode', None)
    87         if cm is not None and cm.startswith('pg'):
    88             form_fields = grok.AutoFields(
    89                 ICustomPGStudentClearance).omit('clearance_locked')
    90         else:
    91             form_fields = grok.AutoFields(
    92                 ICustomUGStudentClearance).omit('clearance_locked')
    93         return form_fields
    94 
    95 class CustomExportPDFClearanceSlipPage(ExportPDFClearanceSlipPage):
     82    grok.context(INigeriaStudent)
     83
     84    @property
     85    def form_fields(self):
     86        cm = getattr(self.context,'current_mode', None)
     87        if cm is not None and cm.startswith('pg'):
     88            form_fields = grok.AutoFields(
     89                INigeriaPGStudentClearance).omit('clearance_locked')
     90        else:
     91            form_fields = grok.AutoFields(
     92                INigeriaUGStudentClearance).omit('clearance_locked')
     93        return form_fields
     94
     95class NigeriaExportPDFClearanceSlipPage(ExportPDFClearanceSlipPage):
    9696    """Deliver a PDF slip of the context.
    9797    """
    98     grok.context(ICustomStudent)
    99 
    100     @property
    101     def form_fields(self):
    102         cm = getattr(self.context,'current_mode', None)
    103         if cm is not None and cm.startswith('pg'):
    104             form_fields = grok.AutoFields(
    105                 ICustomPGStudentClearance).omit('clearance_locked')
    106         else:
    107             form_fields = grok.AutoFields(
    108                 ICustomUGStudentClearance).omit('clearance_locked')
    109         return form_fields
    110 
    111 class CustomStudentClearanceManageFormPage(StudentClearanceManageFormPage):
     98    grok.context(INigeriaStudent)
     99
     100    @property
     101    def form_fields(self):
     102        cm = getattr(self.context,'current_mode', None)
     103        if cm is not None and cm.startswith('pg'):
     104            form_fields = grok.AutoFields(
     105                INigeriaPGStudentClearance).omit('clearance_locked')
     106        else:
     107            form_fields = grok.AutoFields(
     108                INigeriaUGStudentClearance).omit('clearance_locked')
     109        return form_fields
     110
     111class NigeriaStudentClearanceManageFormPage(StudentClearanceManageFormPage):
    112112    """ Page to edit student clearance data
    113113    """
    114     grok.context(ICustomStudent)
    115 
    116     @property
    117     def form_fields(self):
    118         cm = getattr(self.context,'current_mode', None)
    119         if cm is not None and cm.startswith('pg'):
    120             form_fields = grok.AutoFields(ICustomPGStudentClearance)
    121         else:
    122             form_fields = grok.AutoFields(ICustomUGStudentClearance)
    123         return form_fields
    124 
    125 class CustomStudentClearanceEditFormPage(StudentClearanceEditFormPage):
     114    grok.context(INigeriaStudent)
     115
     116    @property
     117    def form_fields(self):
     118        cm = getattr(self.context,'current_mode', None)
     119        if cm is not None and cm.startswith('pg'):
     120            form_fields = grok.AutoFields(INigeriaPGStudentClearance)
     121        else:
     122            form_fields = grok.AutoFields(INigeriaUGStudentClearance)
     123        return form_fields
     124
     125class NigeriaStudentClearanceEditFormPage(StudentClearanceEditFormPage):
    126126    """ View to edit student clearance data by student
    127127    """
    128     grok.context(ICustomStudent)
    129 
    130     @property
    131     def form_fields(self):
    132         cm = getattr(self.context,'current_mode', None)
    133         if cm is not None and cm.startswith('pg'):
    134             form_fields = grok.AutoFields(ICustomPGStudentClearance).omit('clearance_locked')
    135         else:
    136             form_fields = grok.AutoFields(ICustomUGStudentClearance).omit('clearance_locked')
     128    grok.context(INigeriaStudent)
     129
     130    @property
     131    def form_fields(self):
     132        cm = getattr(self.context,'current_mode', None)
     133        if cm is not None and cm.startswith('pg'):
     134            form_fields = grok.AutoFields(INigeriaPGStudentClearance).omit('clearance_locked')
     135        else:
     136            form_fields = grok.AutoFields(INigeriaUGStudentClearance).omit('clearance_locked')
    137137        return form_fields
    138138
     
    149149        return False
    150150
    151 class CustomOnlinePaymentDisplayFormPage(OnlinePaymentDisplayFormPage):
     151class NigeriaOnlinePaymentDisplayFormPage(OnlinePaymentDisplayFormPage):
    152152    """ Page to view an online payment ticket
    153153    """
    154     grok.context(ICustomStudentOnlinePayment)
    155     form_fields = grok.AutoFields(ICustomStudentOnlinePayment)
     154    grok.context(INigeriaStudentOnlinePayment)
     155    form_fields = grok.AutoFields(INigeriaStudentOnlinePayment)
    156156    form_fields[
    157157        'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     
    159159        'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    160160
    161 class CustomOnlinePaymentAddFormPage(OnlinePaymentAddFormPage):
     161class NigeriaOnlinePaymentAddFormPage(OnlinePaymentAddFormPage):
    162162    """ Page to add an online payment ticket
    163163    """
    164     form_fields = grok.AutoFields(ICustomStudentOnlinePayment).select(
     164    form_fields = grok.AutoFields(INigeriaStudentOnlinePayment).select(
    165165        'p_category')
    166166
    167 class CustomOnlinePaymentFakeApprovePage(OnlinePaymentFakeApprovePage):
     167class NigeriaOnlinePaymentFakeApprovePage(OnlinePaymentFakeApprovePage):
    168168    """ Disable payment approval view for students.
    169169
     
    178178        return
    179179
    180 class CustomExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage):
     180class NigeriaExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage):
    181181    """Deliver a PDF slip of the context.
    182182    """
    183     grok.context(ICustomStudentOnlinePayment)
    184     form_fields = grok.AutoFields(ICustomStudentOnlinePayment)
     183    grok.context(INigeriaStudentOnlinePayment)
     184    form_fields = grok.AutoFields(INigeriaStudentOnlinePayment)
    185185    form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    186186    form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     
    196196        return self.view.url(self.view.context, self.target)
    197197
    198 class CustomStudentFilesUploadPage(StudentFilesUploadPage):
     198class NigeriaStudentFilesUploadPage(StudentFilesUploadPage):
    199199    """ View to upload passport picture.
    200200
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/interfaces.py

    r8862 r8863  
    3232    high_qual, high_grade, exam_types, LGASource)
    3333from kofacustom.nigeria.interfaces import MessageFactory as _
    34 from kofacustom.nigeria.payments.interfaces import ICustomOnlinePayment
    35 
    36 
    37 class ICustomStudentBase(IStudentBase):
     34from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment
     35
     36
     37class INigeriaStudentBase(IStudentBase):
    3838    """Representation of student base data.
    3939
     
    4747        )
    4848
    49 class ICustomStudentPersonal(IStudentPersonal):
     49class INigeriaStudentPersonal(IStudentPersonal):
    5050    """Student personal data.
    5151
     
    6161        )
    6262
    63 class ICustomUGStudentClearance(IUGStudentClearance):
     63class INigeriaUGStudentClearance(IUGStudentClearance):
    6464    """Representation of ug student clearance data.
    6565
     
    220220
    221221
    222 class ICustomPGStudentClearance(ICustomUGStudentClearance):
     222class INigeriaPGStudentClearance(INigeriaUGStudentClearance):
    223223    """Representation of pg student clearance data.
    224224
     
    345345
    346346
    347 class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
    348     ICustomPGStudentClearance,ICustomStudentPersonal):
     347class INigeriaStudent(INigeriaStudentBase,INigeriaUGStudentClearance,
     348    INigeriaPGStudentClearance,INigeriaStudentPersonal):
    349349    """Representation of a student.
    350350
    351351    """
    352352
    353 class ICustomStudentStudyCourse(IStudentStudyCourse):
     353class INigeriaStudentStudyCourse(IStudentStudyCourse):
    354354    """A container for student study levels.
    355355
    356356    """
    357357
    358 class ICustomStudentStudyLevel(IStudentStudyLevel):
     358class INigeriaStudentStudyLevel(IStudentStudyLevel):
    359359    """A container for course tickets.
    360360
    361361    """
    362362
    363 class ICustomStudentOnlinePayment(ICustomOnlinePayment):
     363class INigeriaStudentOnlinePayment(INigeriaOnlinePayment):
    364364    """A student payment via payment gateways.
    365365
     
    374374        )
    375375
    376 ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
     376INigeriaStudentOnlinePayment['p_level'].order = INigeriaStudentOnlinePayment[
    377377    'p_session'].order
    378378
    379 class ICustomCourseTicket(ICourseTicket):
     379class INigeriaCourseTicket(ICourseTicket):
    380380    """A course ticket.
    381381
    382382    """
    383383
    384 class ICustomStudentUpdateByRegNo(ICustomStudent):
     384class INigeriaStudentUpdateByRegNo(INigeriaStudent):
    385385    """Representation of a student. Skip regular reg_number validation.
    386386
     
    391391        )
    392392
    393 class ICustomStudentUpdateByMatricNo(ICustomStudent):
     393class INigeriaStudentUpdateByMatricNo(INigeriaStudent):
    394394    """Representation of a student. Skip regular matric_number validation.
    395395
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/payments.py

    r8862 r8863  
    2626    StudentOnlinePayment, StudentOnlinePaymentFactory)
    2727from waeup.kofa.utils.helpers import attrs_to_fields
    28 from kofacustom.nigeria.students.interfaces import ICustomStudentOnlinePayment
     28from kofacustom.nigeria.students.interfaces import INigeriaStudentOnlinePayment
    2929
    30 class CustomStudentOnlinePayment(StudentOnlinePayment):
     30class NigeriaStudentOnlinePayment(StudentOnlinePayment):
    3131    """This is a custom online payment for students.
    3232
     
    3636    can also be accessed in the customized system.
    3737    """
    38     grok.implements(ICustomStudentOnlinePayment, IStudentNavigation)
    39     grok.provides(ICustomStudentOnlinePayment)
     38    grok.implements(INigeriaStudentOnlinePayment, IStudentNavigation)
     39    grok.provides(INigeriaStudentOnlinePayment)
    4040
    4141    def __init__(self):
    42         super(CustomStudentOnlinePayment, self).__init__()
     42        super(NigeriaStudentOnlinePayment, self).__init__()
    4343        return
    4444
     
    4747        return self.__parent__.__parent__
    4848
    49 CustomStudentOnlinePayment = attrs_to_fields(CustomStudentOnlinePayment)
     49NigeriaStudentOnlinePayment = attrs_to_fields(NigeriaStudentOnlinePayment)
    5050
    51 class CustomStudentOnlinePaymentFactory(StudentOnlinePaymentFactory):
     51class NigeriaStudentOnlinePaymentFactory(StudentOnlinePaymentFactory):
    5252    """A factory for student online payments.
    5353    """
    5454
    5555    def __call__(self, *args, **kw):
    56         return CustomStudentOnlinePayment()
     56        return NigeriaStudentOnlinePayment()
    5757
    5858    def getInterfaces(self):
    59         return implementedBy(CustomStudentOnlinePayment)
     59        return implementedBy(NigeriaStudentOnlinePayment)
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/student.py

    r8862 r8863  
    2323from waeup.kofa.utils.helpers import attrs_to_fields
    2424from waeup.kofa.students.student import Student, StudentFactory
    25 from kofacustom.nigeria.students.interfaces import ICustomStudent, IStudentNavigation
     25from kofacustom.nigeria.students.interfaces import INigeriaStudent, IStudentNavigation
    2626
    2727
    28 class CustomStudent(Student):
     28class NigeriaStudent(Student):
    2929    """This is a student container for the various objects
    3030    owned by students.
    3131    """
    32     grok.implements(ICustomStudent, IStudentNavigation)
    33     grok.provides(ICustomStudent)
     32    grok.implements(INigeriaStudent, IStudentNavigation)
     33    grok.provides(INigeriaStudent)
    3434
    3535
     
    3838# ourselves and as a bonus we get free validation when an attribute is
    3939# set.
    40 CustomStudent = attrs_to_fields(CustomStudent)
     40NigeriaStudent = attrs_to_fields(NigeriaStudent)
    4141
    42 class CustomStudentFactory(StudentFactory):
     42class NigeriaStudentFactory(StudentFactory):
    4343    """A factory for students.
    4444    """
    4545
    4646    def __call__(self, *args, **kw):
    47         return CustomStudent()
     47        return NigeriaStudent()
    4848
    4949    def getInterfaces(self):
    50         return implementedBy(CustomStudent)
     50        return implementedBy(NigeriaStudent)
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/studycourse.py

    r8862 r8863  
    2727from waeup.kofa.students.workflow import CLEARED, RETURNING, PAID
    2828from kofacustom.nigeria.students.interfaces import (
    29     ICustomStudentStudyCourse, IStudentNavigation)
     29    INigeriaStudentStudyCourse, IStudentNavigation)
    3030
    31 class CustomStudentStudyCourse(StudentStudyCourse):
     31class NigeriaStudentStudyCourse(StudentStudyCourse):
    3232    """This is a container for study levels.
    3333    """
    3434
    35     grok.implements(ICustomStudentStudyCourse, IStudentNavigation)
    36     grok.provides(ICustomStudentStudyCourse)
     35    grok.implements(INigeriaStudentStudyCourse, IStudentNavigation)
     36    grok.provides(INigeriaStudentStudyCourse)
    3737
    3838    @property
     
    6060        return False
    6161
    62 CustomStudentStudyCourse = attrs_to_fields(CustomStudentStudyCourse)
     62NigeriaStudentStudyCourse = attrs_to_fields(NigeriaStudentStudyCourse)
    6363
    64 class CustomStudentStudyCourseFactory(StudentStudyCourseFactory):
     64class NigeriaStudentStudyCourseFactory(StudentStudyCourseFactory):
    6565    """A factory for student study courses.
    6666    """
    6767
    6868    def __call__(self, *args, **kw):
    69         return CustomStudentStudyCourse()
     69        return NigeriaStudentStudyCourse()
    7070
    7171    def getInterfaces(self):
    72         return implementedBy(CustomStudentStudyCourse)
     72        return implementedBy(NigeriaStudentStudyCourse)
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/studylevel.py

    r8862 r8863  
    2828    CourseTicketFactory, StudentStudyLevelFactory)
    2929from kofacustom.nigeria.students.interfaces import (
    30     ICustomStudentStudyLevel, IStudentNavigation, ICustomCourseTicket)
     30    INigeriaStudentStudyLevel, IStudentNavigation, INigeriaCourseTicket)
    3131
    3232
    33 class CustomStudentStudyLevel(StudentStudyLevel):
     33class NigeriaStudentStudyLevel(StudentStudyLevel):
    3434    """This is a container for course tickets.
    3535    """
    36     grok.implements(ICustomStudentStudyLevel, IStudentNavigation)
    37     grok.provides(ICustomStudentStudyLevel)
     36    grok.implements(INigeriaStudentStudyLevel, IStudentNavigation)
     37    grok.provides(INigeriaStudentStudyLevel)
    3838
    39 CustomStudentStudyLevel = attrs_to_fields(CustomStudentStudyLevel)
     39NigeriaStudentStudyLevel = attrs_to_fields(NigeriaStudentStudyLevel)
    4040
    41 class CustomStudentStudyLevelFactory(StudentStudyLevelFactory):
     41class NigeriaStudentStudyLevelFactory(StudentStudyLevelFactory):
    4242    """A factory for student study levels.
    4343    """
    4444
    4545    def __call__(self, *args, **kw):
    46         return CustomStudentStudyLevel()
     46        return NigeriaStudentStudyLevel()
    4747
    4848    def getInterfaces(self):
    49         return implementedBy(CustomStudentStudyLevel)
     49        return implementedBy(NigeriaStudentStudyLevel)
    5050
    51 class CustomCourseTicket(CourseTicket):
     51class NigeriaCourseTicket(CourseTicket):
    5252    """This is a course ticket which allows the
    5353    student to attend the course. Lecturers will enter scores and more at
     
    5959    triggered actions on course tickets.
    6060    """
    61     grok.implements(ICustomCourseTicket, IStudentNavigation)
    62     grok.provides(ICustomCourseTicket)
     61    grok.implements(INigeriaCourseTicket, IStudentNavigation)
     62    grok.provides(INigeriaCourseTicket)
    6363
    64 CustomCourseTicket = attrs_to_fields(CustomCourseTicket)
     64NigeriaCourseTicket = attrs_to_fields(NigeriaCourseTicket)
    6565
    66 class CustomCourseTicketFactory(CourseTicketFactory):
     66class NigeriaCourseTicketFactory(CourseTicketFactory):
    6767    """A factory for student study levels.
    6868    """
    6969
    7070    def __call__(self, *args, **kw):
    71         return CustomCourseTicket()
     71        return NigeriaCourseTicket()
    7272
    7373    def getInterfaces(self):
    74         return implementedBy(CustomCourseTicket)
     74        return implementedBy(NigeriaCourseTicket)
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py

    r8862 r8863  
    3131from waeup.kofa.students.batching import StudentProcessor
    3232from waeup.kofa.students.interfaces import IStudentsUtils
    33 from kofacustom.nigeria.students.batching import CustomStudentProcessor
     33from kofacustom.nigeria.students.batching import NigeriaStudentProcessor
    3434from kofacustom.nigeria.testing import FunctionalLayer
    3535from kofacustom.nigeria.students.interfaces import (
    36     ICustomStudentStudyCourse, ICustomStudent,
    37     ICustomStudentStudyLevel, ICustomCourseTicket)
     36    INigeriaStudentStudyCourse, INigeriaStudent,
     37    INigeriaStudentStudyLevel, INigeriaCourseTicket)
    3838
    3939
     
    6969
    7070        self.processor_base = StudentProcessor()
    71         self.processor = CustomStudentProcessor()
     71        self.processor = NigeriaStudentProcessor()
    7272        self.workdir = tempfile.mkdtemp()
    7373        self.csv_file = os.path.join(self.workdir, 'sample_student_data.csv')
     
    108108        # Let's see if objects created in the customized
    109109        # portal really implement the customized interfaces
    110         verify.verifyObject(ICustomStudent, self.student)
     110        verify.verifyObject(INigeriaStudent, self.student)
    111111        verify.verifyObject(
    112             ICustomStudentStudyCourse, self.student['studycourse'])
     112            INigeriaStudentStudyCourse, self.student['studycourse'])
    113113        studylevel = createObject(u'waeup.StudentStudyLevel')
    114         verify.verifyObject(ICustomStudentStudyLevel, studylevel)
     114        verify.verifyObject(INigeriaStudentStudyLevel, studylevel)
    115115        ticket = createObject(u'waeup.CourseTicket')
    116         verify.verifyObject(ICustomCourseTicket, ticket)
     116        verify.verifyObject(INigeriaCourseTicket, ticket)
    117117        IWorkflowState(self.student).setState('returning')
    118118        # Let's see if next_session_allowed works as expected
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_student.py

    r8862 r8863  
    2222from zope.interface import verify
    2323from waeup.kofa.testing import FunctionalTestCase
    24 from kofacustom.nigeria.students.student import CustomStudent, CustomStudentFactory
     24from kofacustom.nigeria.students.student import NigeriaStudent, NigeriaStudentFactory
    2525from kofacustom.nigeria.students.studycourse import (
    26     CustomStudentStudyCourse, CustomStudentStudyCourseFactory)
     26    NigeriaStudentStudyCourse, NigeriaStudentStudyCourseFactory)
    2727from kofacustom.nigeria.students.studylevel import (
    28     CustomStudentStudyLevel, CustomCourseTicket,
    29     CustomStudentStudyLevelFactory,
    30     CustomCourseTicketFactory)
     28    NigeriaStudentStudyLevel, NigeriaCourseTicket,
     29    NigeriaStudentStudyLevelFactory,
     30    NigeriaCourseTicketFactory)
    3131from kofacustom.nigeria.students.interfaces import (
    32     ICustomStudent, ICustomStudentStudyCourse,
    33     ICustomStudentStudyLevel, ICustomCourseTicket)
     32    INigeriaStudent, INigeriaStudentStudyCourse,
     33    INigeriaStudentStudyLevel, INigeriaCourseTicket)
    3434from kofacustom.nigeria.testing import FunctionalLayer
    3535
    3636
    37 class CustomStudentFactoryTest(FunctionalTestCase):
     37class NigeriaStudentFactoryTest(FunctionalTestCase):
    3838
    3939    layer = FunctionalLayer
    4040
    4141    def setUp(self):
    42         super(CustomStudentFactoryTest, self).setUp()
    43         self.factory = CustomStudentFactory()
     42        super(NigeriaStudentFactoryTest, self).setUp()
     43        self.factory = NigeriaStudentFactory()
    4444
    4545    def tearDown(self):
    46         super(CustomStudentFactoryTest, self).tearDown()
     46        super(NigeriaStudentFactoryTest, self).tearDown()
    4747
    4848    def test_interfaces(self):
    49         verify.verifyClass(IFactory, CustomStudentFactory)
     49        verify.verifyClass(IFactory, NigeriaStudentFactory)
    5050        verify.verifyObject(IFactory, self.factory)
    5151
    5252    def test_factory(self):
    5353        obj = self.factory()
    54         assert isinstance(obj, CustomStudent)
     54        assert isinstance(obj, NigeriaStudent)
    5555
    5656    def test_getInterfaces(self):
    5757        implemented_by = self.factory.getInterfaces()
    58         assert implemented_by.isOrExtends(ICustomStudent)
     58        assert implemented_by.isOrExtends(INigeriaStudent)
    5959
    60 class CustomStudentStudyCourseFactoryTest(FunctionalTestCase):
     60class NigeriaStudentStudyCourseFactoryTest(FunctionalTestCase):
    6161
    6262    layer = FunctionalLayer
    6363
    6464    def setUp(self):
    65         super(CustomStudentStudyCourseFactoryTest, self).setUp()
    66         self.factory = CustomStudentStudyCourseFactory()
     65        super(NigeriaStudentStudyCourseFactoryTest, self).setUp()
     66        self.factory = NigeriaStudentStudyCourseFactory()
    6767
    6868    def tearDown(self):
    69         super(CustomStudentStudyCourseFactoryTest, self).tearDown()
     69        super(NigeriaStudentStudyCourseFactoryTest, self).tearDown()
    7070
    7171    def test_interfaces(self):
    72         verify.verifyClass(IFactory, CustomStudentStudyCourseFactory)
     72        verify.verifyClass(IFactory, NigeriaStudentStudyCourseFactory)
    7373        verify.verifyObject(IFactory, self.factory)
    7474
    7575    def test_factory(self):
    7676        obj = self.factory()
    77         assert isinstance(obj, CustomStudentStudyCourse)
     77        assert isinstance(obj, NigeriaStudentStudyCourse)
    7878
    7979    def test_getInterfaces(self):
    8080        implemented_by = self.factory.getInterfaces()
    81         assert implemented_by.isOrExtends(ICustomStudentStudyCourse)
     81        assert implemented_by.isOrExtends(INigeriaStudentStudyCourse)
    8282
    83 class CustomStudentStudyLevelFactoryTest(FunctionalTestCase):
     83class NigeriaStudentStudyLevelFactoryTest(FunctionalTestCase):
    8484
    8585    layer = FunctionalLayer
    8686
    8787    def setUp(self):
    88         super(CustomStudentStudyLevelFactoryTest, self).setUp()
    89         self.factory = CustomStudentStudyLevelFactory()
     88        super(NigeriaStudentStudyLevelFactoryTest, self).setUp()
     89        self.factory = NigeriaStudentStudyLevelFactory()
    9090
    9191    def tearDown(self):
    92         super(CustomStudentStudyLevelFactoryTest, self).tearDown()
     92        super(NigeriaStudentStudyLevelFactoryTest, self).tearDown()
    9393
    9494    def test_interfaces(self):
    95         verify.verifyClass(IFactory, CustomStudentStudyLevelFactory)
     95        verify.verifyClass(IFactory, NigeriaStudentStudyLevelFactory)
    9696        verify.verifyObject(IFactory, self.factory)
    9797
    9898    def test_factory(self):
    9999        obj = self.factory()
    100         assert isinstance(obj, CustomStudentStudyLevel)
     100        assert isinstance(obj, NigeriaStudentStudyLevel)
    101101
    102102    def test_getInterfaces(self):
    103103        implemented_by = self.factory.getInterfaces()
    104         assert implemented_by.isOrExtends(ICustomStudentStudyLevel)
     104        assert implemented_by.isOrExtends(INigeriaStudentStudyLevel)
    105105
    106 class CustomCourseTicketFactoryTest(FunctionalTestCase):
     106class NigeriaCourseTicketFactoryTest(FunctionalTestCase):
    107107
    108108    layer = FunctionalLayer
    109109
    110110    def setUp(self):
    111         super(CustomCourseTicketFactoryTest, self).setUp()
    112         self.factory = CustomCourseTicketFactory()
     111        super(NigeriaCourseTicketFactoryTest, self).setUp()
     112        self.factory = NigeriaCourseTicketFactory()
    113113
    114114    def tearDown(self):
    115         super(CustomCourseTicketFactoryTest, self).tearDown()
     115        super(NigeriaCourseTicketFactoryTest, self).tearDown()
    116116
    117117    def test_interfaces(self):
    118         verify.verifyClass(IFactory, CustomCourseTicketFactory)
     118        verify.verifyClass(IFactory, NigeriaCourseTicketFactory)
    119119        verify.verifyObject(IFactory, self.factory)
    120120
    121121    def test_factory(self):
    122122        obj = self.factory()
    123         assert isinstance(obj, CustomCourseTicket)
     123        assert isinstance(obj, NigeriaCourseTicket)
    124124
    125125    def test_getInterfaces(self):
    126126        implemented_by = self.factory.getInterfaces()
    127         assert implemented_by.isOrExtends(ICustomCourseTicket)
     127        assert implemented_by.isOrExtends(INigeriaCourseTicket)
Note: See TracChangeset for help on using the changeset viewer.