- Timestamp:
- 1 Jul 2012, 12:31:04 (12 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/batching.py
r8862 r8863 25 25 """ 26 26 from kofacustom.nigeria.students.interfaces import ( 27 I CustomStudent, ICustomStudentUpdateByRegNo,28 I CustomStudentUpdateByMatricNo27 INigeriaStudent, INigeriaStudentUpdateByRegNo, 28 INigeriaStudentUpdateByMatricNo 29 29 ) 30 30 from waeup.kofa.students.batching import StudentProcessor 31 31 32 class CustomStudentProcessor(StudentProcessor):32 class NigeriaStudentProcessor(StudentProcessor): 33 33 """A batch processor for IStudent objects. 34 34 """ 35 iface = I CustomStudent36 iface_byregnumber = I CustomStudentUpdateByRegNo37 iface_bymatricnumber = I CustomStudentUpdateByMatricNo35 iface = INigeriaStudent 36 iface_byregnumber = INigeriaStudentUpdateByRegNo 37 iface_bymatricnumber = INigeriaStudentUpdateByMatricNo -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py
r8862 r8863 35 35 PaymentReceiptActionButton, StudentPassportActionButton) 36 36 from kofacustom.nigeria.students.interfaces import ( 37 I CustomStudentBase, ICustomStudent, ICustomStudentPersonal,38 I CustomUGStudentClearance,ICustomPGStudentClearance,39 I CustomStudentOnlinePayment,37 INigeriaStudentBase, INigeriaStudent, INigeriaStudentPersonal, 38 INigeriaUGStudentClearance,INigeriaPGStudentClearance, 39 INigeriaStudentOnlinePayment, 40 40 ) 41 41 from waeup.kofa.students.workflow import ADMITTED 42 42 from kofacustom.nigeria.interfaces import MessageFactory as _ 43 43 44 class CustomOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb):44 class NigeriaOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb): 45 45 """A breadcrumb for payments. 46 46 """ 47 grok.context(I CustomStudentOnlinePayment)47 grok.context(INigeriaStudentOnlinePayment) 48 48 49 49 class PaymentReceiptActionButton(PaymentReceiptActionButton): 50 50 grok.order(4) 51 grok.context(I CustomStudentOnlinePayment)52 53 class CustomStudentBaseManageFormPage(StudentBaseManageFormPage):51 grok.context(INigeriaStudentOnlinePayment) 52 53 class NigeriaStudentBaseManageFormPage(StudentBaseManageFormPage): 54 54 """ View to manage student base data 55 55 """ 56 form_fields = grok.AutoFields(I CustomStudentBase).omit('student_id')57 58 class CustomStudentBaseEditFormPage(StudentBaseEditFormPage):56 form_fields = grok.AutoFields(INigeriaStudentBase).omit('student_id') 57 58 class NigeriaStudentBaseEditFormPage(StudentBaseEditFormPage): 59 59 """ View to edit student base data 60 60 """ 61 form_fields = grok.AutoFields(I CustomStudentBase).select(61 form_fields = grok.AutoFields(INigeriaStudentBase).select( 62 62 'email', 'phone') 63 63 64 64 65 class CustomStudentPersonalDisplayFormPage(StudentPersonalDisplayFormPage):65 class NigeriaStudentPersonalDisplayFormPage(StudentPersonalDisplayFormPage): 66 66 """ Page to display student personal data 67 67 """ 68 grok.context(I CustomStudent)69 form_fields = grok.AutoFields(I CustomStudentPersonal)68 grok.context(INigeriaStudent) 69 form_fields = grok.AutoFields(INigeriaStudentPersonal) 70 70 form_fields['perm_address'].custom_widget = BytesDisplayWidget 71 71 72 72 73 class CustomStudentPersonalEditFormPage(StudentPersonalEditFormPage):73 class NigeriaStudentPersonalEditFormPage(StudentPersonalEditFormPage): 74 74 """ Page to edit personal data 75 75 """ 76 form_fields = grok.AutoFields(I CustomStudentPersonal)77 78 79 class CustomStudentClearanceDisplayFormPage(StudentClearanceDisplayFormPage):76 form_fields = grok.AutoFields(INigeriaStudentPersonal) 77 78 79 class NigeriaStudentClearanceDisplayFormPage(StudentClearanceDisplayFormPage): 80 80 """ Page to display student clearance data 81 81 """ 82 grok.context(I CustomStudent)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 I CustomPGStudentClearance).omit('clearance_locked')90 else: 91 form_fields = grok.AutoFields( 92 I CustomUGStudentClearance).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 95 class NigeriaExportPDFClearanceSlipPage(ExportPDFClearanceSlipPage): 96 96 """Deliver a PDF slip of the context. 97 97 """ 98 grok.context(I CustomStudent)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 I CustomPGStudentClearance).omit('clearance_locked')106 else: 107 form_fields = grok.AutoFields( 108 I CustomUGStudentClearance).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 111 class NigeriaStudentClearanceManageFormPage(StudentClearanceManageFormPage): 112 112 """ Page to edit student clearance data 113 113 """ 114 grok.context(I CustomStudent)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(I CustomPGStudentClearance)121 else: 122 form_fields = grok.AutoFields(I CustomUGStudentClearance)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 125 class NigeriaStudentClearanceEditFormPage(StudentClearanceEditFormPage): 126 126 """ View to edit student clearance data by student 127 127 """ 128 grok.context(I CustomStudent)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(I CustomPGStudentClearance).omit('clearance_locked')135 else: 136 form_fields = grok.AutoFields(I CustomUGStudentClearance).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') 137 137 return form_fields 138 138 … … 149 149 return False 150 150 151 class CustomOnlinePaymentDisplayFormPage(OnlinePaymentDisplayFormPage):151 class NigeriaOnlinePaymentDisplayFormPage(OnlinePaymentDisplayFormPage): 152 152 """ Page to view an online payment ticket 153 153 """ 154 grok.context(I CustomStudentOnlinePayment)155 form_fields = grok.AutoFields(I CustomStudentOnlinePayment)154 grok.context(INigeriaStudentOnlinePayment) 155 form_fields = grok.AutoFields(INigeriaStudentOnlinePayment) 156 156 form_fields[ 157 157 'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') … … 159 159 'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 160 160 161 class CustomOnlinePaymentAddFormPage(OnlinePaymentAddFormPage):161 class NigeriaOnlinePaymentAddFormPage(OnlinePaymentAddFormPage): 162 162 """ Page to add an online payment ticket 163 163 """ 164 form_fields = grok.AutoFields(I CustomStudentOnlinePayment).select(164 form_fields = grok.AutoFields(INigeriaStudentOnlinePayment).select( 165 165 'p_category') 166 166 167 class CustomOnlinePaymentFakeApprovePage(OnlinePaymentFakeApprovePage):167 class NigeriaOnlinePaymentFakeApprovePage(OnlinePaymentFakeApprovePage): 168 168 """ Disable payment approval view for students. 169 169 … … 178 178 return 179 179 180 class CustomExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage):180 class NigeriaExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage): 181 181 """Deliver a PDF slip of the context. 182 182 """ 183 grok.context(I CustomStudentOnlinePayment)184 form_fields = grok.AutoFields(I CustomStudentOnlinePayment)183 grok.context(INigeriaStudentOnlinePayment) 184 form_fields = grok.AutoFields(INigeriaStudentOnlinePayment) 185 185 form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 186 186 form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') … … 196 196 return self.view.url(self.view.context, self.target) 197 197 198 class CustomStudentFilesUploadPage(StudentFilesUploadPage):198 class NigeriaStudentFilesUploadPage(StudentFilesUploadPage): 199 199 """ View to upload passport picture. 200 200 -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/interfaces.py
r8862 r8863 32 32 high_qual, high_grade, exam_types, LGASource) 33 33 from kofacustom.nigeria.interfaces import MessageFactory as _ 34 from kofacustom.nigeria.payments.interfaces import I CustomOnlinePayment35 36 37 class I CustomStudentBase(IStudentBase):34 from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment 35 36 37 class INigeriaStudentBase(IStudentBase): 38 38 """Representation of student base data. 39 39 … … 47 47 ) 48 48 49 class I CustomStudentPersonal(IStudentPersonal):49 class INigeriaStudentPersonal(IStudentPersonal): 50 50 """Student personal data. 51 51 … … 61 61 ) 62 62 63 class I CustomUGStudentClearance(IUGStudentClearance):63 class INigeriaUGStudentClearance(IUGStudentClearance): 64 64 """Representation of ug student clearance data. 65 65 … … 220 220 221 221 222 class I CustomPGStudentClearance(ICustomUGStudentClearance):222 class INigeriaPGStudentClearance(INigeriaUGStudentClearance): 223 223 """Representation of pg student clearance data. 224 224 … … 345 345 346 346 347 class I CustomStudent(ICustomStudentBase,ICustomUGStudentClearance,348 I CustomPGStudentClearance,ICustomStudentPersonal):347 class INigeriaStudent(INigeriaStudentBase,INigeriaUGStudentClearance, 348 INigeriaPGStudentClearance,INigeriaStudentPersonal): 349 349 """Representation of a student. 350 350 351 351 """ 352 352 353 class I CustomStudentStudyCourse(IStudentStudyCourse):353 class INigeriaStudentStudyCourse(IStudentStudyCourse): 354 354 """A container for student study levels. 355 355 356 356 """ 357 357 358 class I CustomStudentStudyLevel(IStudentStudyLevel):358 class INigeriaStudentStudyLevel(IStudentStudyLevel): 359 359 """A container for course tickets. 360 360 361 361 """ 362 362 363 class I CustomStudentOnlinePayment(ICustomOnlinePayment):363 class INigeriaStudentOnlinePayment(INigeriaOnlinePayment): 364 364 """A student payment via payment gateways. 365 365 … … 374 374 ) 375 375 376 I CustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[376 INigeriaStudentOnlinePayment['p_level'].order = INigeriaStudentOnlinePayment[ 377 377 'p_session'].order 378 378 379 class I CustomCourseTicket(ICourseTicket):379 class INigeriaCourseTicket(ICourseTicket): 380 380 """A course ticket. 381 381 382 382 """ 383 383 384 class I CustomStudentUpdateByRegNo(ICustomStudent):384 class INigeriaStudentUpdateByRegNo(INigeriaStudent): 385 385 """Representation of a student. Skip regular reg_number validation. 386 386 … … 391 391 ) 392 392 393 class I CustomStudentUpdateByMatricNo(ICustomStudent):393 class INigeriaStudentUpdateByMatricNo(INigeriaStudent): 394 394 """Representation of a student. Skip regular matric_number validation. 395 395 -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/payments.py
r8862 r8863 26 26 StudentOnlinePayment, StudentOnlinePaymentFactory) 27 27 from waeup.kofa.utils.helpers import attrs_to_fields 28 from kofacustom.nigeria.students.interfaces import I CustomStudentOnlinePayment28 from kofacustom.nigeria.students.interfaces import INigeriaStudentOnlinePayment 29 29 30 class CustomStudentOnlinePayment(StudentOnlinePayment):30 class NigeriaStudentOnlinePayment(StudentOnlinePayment): 31 31 """This is a custom online payment for students. 32 32 … … 36 36 can also be accessed in the customized system. 37 37 """ 38 grok.implements(I CustomStudentOnlinePayment, IStudentNavigation)39 grok.provides(I CustomStudentOnlinePayment)38 grok.implements(INigeriaStudentOnlinePayment, IStudentNavigation) 39 grok.provides(INigeriaStudentOnlinePayment) 40 40 41 41 def __init__(self): 42 super( CustomStudentOnlinePayment, self).__init__()42 super(NigeriaStudentOnlinePayment, self).__init__() 43 43 return 44 44 … … 47 47 return self.__parent__.__parent__ 48 48 49 CustomStudentOnlinePayment = attrs_to_fields(CustomStudentOnlinePayment)49 NigeriaStudentOnlinePayment = attrs_to_fields(NigeriaStudentOnlinePayment) 50 50 51 class CustomStudentOnlinePaymentFactory(StudentOnlinePaymentFactory):51 class NigeriaStudentOnlinePaymentFactory(StudentOnlinePaymentFactory): 52 52 """A factory for student online payments. 53 53 """ 54 54 55 55 def __call__(self, *args, **kw): 56 return CustomStudentOnlinePayment()56 return NigeriaStudentOnlinePayment() 57 57 58 58 def getInterfaces(self): 59 return implementedBy( CustomStudentOnlinePayment)59 return implementedBy(NigeriaStudentOnlinePayment) -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/student.py
r8862 r8863 23 23 from waeup.kofa.utils.helpers import attrs_to_fields 24 24 from waeup.kofa.students.student import Student, StudentFactory 25 from kofacustom.nigeria.students.interfaces import I CustomStudent, IStudentNavigation25 from kofacustom.nigeria.students.interfaces import INigeriaStudent, IStudentNavigation 26 26 27 27 28 class CustomStudent(Student):28 class NigeriaStudent(Student): 29 29 """This is a student container for the various objects 30 30 owned by students. 31 31 """ 32 grok.implements(I CustomStudent, IStudentNavigation)33 grok.provides(I CustomStudent)32 grok.implements(INigeriaStudent, IStudentNavigation) 33 grok.provides(INigeriaStudent) 34 34 35 35 … … 38 38 # ourselves and as a bonus we get free validation when an attribute is 39 39 # set. 40 CustomStudent = attrs_to_fields(CustomStudent)40 NigeriaStudent = attrs_to_fields(NigeriaStudent) 41 41 42 class CustomStudentFactory(StudentFactory):42 class NigeriaStudentFactory(StudentFactory): 43 43 """A factory for students. 44 44 """ 45 45 46 46 def __call__(self, *args, **kw): 47 return CustomStudent()47 return NigeriaStudent() 48 48 49 49 def getInterfaces(self): 50 return implementedBy( CustomStudent)50 return implementedBy(NigeriaStudent) -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/studycourse.py
r8862 r8863 27 27 from waeup.kofa.students.workflow import CLEARED, RETURNING, PAID 28 28 from kofacustom.nigeria.students.interfaces import ( 29 I CustomStudentStudyCourse, IStudentNavigation)29 INigeriaStudentStudyCourse, IStudentNavigation) 30 30 31 class CustomStudentStudyCourse(StudentStudyCourse):31 class NigeriaStudentStudyCourse(StudentStudyCourse): 32 32 """This is a container for study levels. 33 33 """ 34 34 35 grok.implements(I CustomStudentStudyCourse, IStudentNavigation)36 grok.provides(I CustomStudentStudyCourse)35 grok.implements(INigeriaStudentStudyCourse, IStudentNavigation) 36 grok.provides(INigeriaStudentStudyCourse) 37 37 38 38 @property … … 60 60 return False 61 61 62 CustomStudentStudyCourse = attrs_to_fields(CustomStudentStudyCourse)62 NigeriaStudentStudyCourse = attrs_to_fields(NigeriaStudentStudyCourse) 63 63 64 class CustomStudentStudyCourseFactory(StudentStudyCourseFactory):64 class NigeriaStudentStudyCourseFactory(StudentStudyCourseFactory): 65 65 """A factory for student study courses. 66 66 """ 67 67 68 68 def __call__(self, *args, **kw): 69 return CustomStudentStudyCourse()69 return NigeriaStudentStudyCourse() 70 70 71 71 def getInterfaces(self): 72 return implementedBy( CustomStudentStudyCourse)72 return implementedBy(NigeriaStudentStudyCourse) -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/studylevel.py
r8862 r8863 28 28 CourseTicketFactory, StudentStudyLevelFactory) 29 29 from kofacustom.nigeria.students.interfaces import ( 30 I CustomStudentStudyLevel, IStudentNavigation, ICustomCourseTicket)30 INigeriaStudentStudyLevel, IStudentNavigation, INigeriaCourseTicket) 31 31 32 32 33 class CustomStudentStudyLevel(StudentStudyLevel):33 class NigeriaStudentStudyLevel(StudentStudyLevel): 34 34 """This is a container for course tickets. 35 35 """ 36 grok.implements(I CustomStudentStudyLevel, IStudentNavigation)37 grok.provides(I CustomStudentStudyLevel)36 grok.implements(INigeriaStudentStudyLevel, IStudentNavigation) 37 grok.provides(INigeriaStudentStudyLevel) 38 38 39 CustomStudentStudyLevel = attrs_to_fields(CustomStudentStudyLevel)39 NigeriaStudentStudyLevel = attrs_to_fields(NigeriaStudentStudyLevel) 40 40 41 class CustomStudentStudyLevelFactory(StudentStudyLevelFactory):41 class NigeriaStudentStudyLevelFactory(StudentStudyLevelFactory): 42 42 """A factory for student study levels. 43 43 """ 44 44 45 45 def __call__(self, *args, **kw): 46 return CustomStudentStudyLevel()46 return NigeriaStudentStudyLevel() 47 47 48 48 def getInterfaces(self): 49 return implementedBy( CustomStudentStudyLevel)49 return implementedBy(NigeriaStudentStudyLevel) 50 50 51 class CustomCourseTicket(CourseTicket):51 class NigeriaCourseTicket(CourseTicket): 52 52 """This is a course ticket which allows the 53 53 student to attend the course. Lecturers will enter scores and more at … … 59 59 triggered actions on course tickets. 60 60 """ 61 grok.implements(I CustomCourseTicket, IStudentNavigation)62 grok.provides(I CustomCourseTicket)61 grok.implements(INigeriaCourseTicket, IStudentNavigation) 62 grok.provides(INigeriaCourseTicket) 63 63 64 CustomCourseTicket = attrs_to_fields(CustomCourseTicket)64 NigeriaCourseTicket = attrs_to_fields(NigeriaCourseTicket) 65 65 66 class CustomCourseTicketFactory(CourseTicketFactory):66 class NigeriaCourseTicketFactory(CourseTicketFactory): 67 67 """A factory for student study levels. 68 68 """ 69 69 70 70 def __call__(self, *args, **kw): 71 return CustomCourseTicket()71 return NigeriaCourseTicket() 72 72 73 73 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 31 31 from waeup.kofa.students.batching import StudentProcessor 32 32 from waeup.kofa.students.interfaces import IStudentsUtils 33 from kofacustom.nigeria.students.batching import CustomStudentProcessor33 from kofacustom.nigeria.students.batching import NigeriaStudentProcessor 34 34 from kofacustom.nigeria.testing import FunctionalLayer 35 35 from kofacustom.nigeria.students.interfaces import ( 36 I CustomStudentStudyCourse, ICustomStudent,37 I CustomStudentStudyLevel, ICustomCourseTicket)36 INigeriaStudentStudyCourse, INigeriaStudent, 37 INigeriaStudentStudyLevel, INigeriaCourseTicket) 38 38 39 39 … … 69 69 70 70 self.processor_base = StudentProcessor() 71 self.processor = CustomStudentProcessor()71 self.processor = NigeriaStudentProcessor() 72 72 self.workdir = tempfile.mkdtemp() 73 73 self.csv_file = os.path.join(self.workdir, 'sample_student_data.csv') … … 108 108 # Let's see if objects created in the customized 109 109 # portal really implement the customized interfaces 110 verify.verifyObject(I CustomStudent, self.student)110 verify.verifyObject(INigeriaStudent, self.student) 111 111 verify.verifyObject( 112 I CustomStudentStudyCourse, self.student['studycourse'])112 INigeriaStudentStudyCourse, self.student['studycourse']) 113 113 studylevel = createObject(u'waeup.StudentStudyLevel') 114 verify.verifyObject(I CustomStudentStudyLevel, studylevel)114 verify.verifyObject(INigeriaStudentStudyLevel, studylevel) 115 115 ticket = createObject(u'waeup.CourseTicket') 116 verify.verifyObject(I CustomCourseTicket, ticket)116 verify.verifyObject(INigeriaCourseTicket, ticket) 117 117 IWorkflowState(self.student).setState('returning') 118 118 # Let's see if next_session_allowed works as expected -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_student.py
r8862 r8863 22 22 from zope.interface import verify 23 23 from waeup.kofa.testing import FunctionalTestCase 24 from kofacustom.nigeria.students.student import CustomStudent, CustomStudentFactory24 from kofacustom.nigeria.students.student import NigeriaStudent, NigeriaStudentFactory 25 25 from kofacustom.nigeria.students.studycourse import ( 26 CustomStudentStudyCourse, CustomStudentStudyCourseFactory)26 NigeriaStudentStudyCourse, NigeriaStudentStudyCourseFactory) 27 27 from kofacustom.nigeria.students.studylevel import ( 28 CustomStudentStudyLevel, CustomCourseTicket,29 CustomStudentStudyLevelFactory,30 CustomCourseTicketFactory)28 NigeriaStudentStudyLevel, NigeriaCourseTicket, 29 NigeriaStudentStudyLevelFactory, 30 NigeriaCourseTicketFactory) 31 31 from kofacustom.nigeria.students.interfaces import ( 32 I CustomStudent, ICustomStudentStudyCourse,33 I CustomStudentStudyLevel, ICustomCourseTicket)32 INigeriaStudent, INigeriaStudentStudyCourse, 33 INigeriaStudentStudyLevel, INigeriaCourseTicket) 34 34 from kofacustom.nigeria.testing import FunctionalLayer 35 35 36 36 37 class CustomStudentFactoryTest(FunctionalTestCase):37 class NigeriaStudentFactoryTest(FunctionalTestCase): 38 38 39 39 layer = FunctionalLayer 40 40 41 41 def setUp(self): 42 super( CustomStudentFactoryTest, self).setUp()43 self.factory = CustomStudentFactory()42 super(NigeriaStudentFactoryTest, self).setUp() 43 self.factory = NigeriaStudentFactory() 44 44 45 45 def tearDown(self): 46 super( CustomStudentFactoryTest, self).tearDown()46 super(NigeriaStudentFactoryTest, self).tearDown() 47 47 48 48 def test_interfaces(self): 49 verify.verifyClass(IFactory, CustomStudentFactory)49 verify.verifyClass(IFactory, NigeriaStudentFactory) 50 50 verify.verifyObject(IFactory, self.factory) 51 51 52 52 def test_factory(self): 53 53 obj = self.factory() 54 assert isinstance(obj, CustomStudent)54 assert isinstance(obj, NigeriaStudent) 55 55 56 56 def test_getInterfaces(self): 57 57 implemented_by = self.factory.getInterfaces() 58 assert implemented_by.isOrExtends(I CustomStudent)58 assert implemented_by.isOrExtends(INigeriaStudent) 59 59 60 class CustomStudentStudyCourseFactoryTest(FunctionalTestCase):60 class NigeriaStudentStudyCourseFactoryTest(FunctionalTestCase): 61 61 62 62 layer = FunctionalLayer 63 63 64 64 def setUp(self): 65 super( CustomStudentStudyCourseFactoryTest, self).setUp()66 self.factory = CustomStudentStudyCourseFactory()65 super(NigeriaStudentStudyCourseFactoryTest, self).setUp() 66 self.factory = NigeriaStudentStudyCourseFactory() 67 67 68 68 def tearDown(self): 69 super( CustomStudentStudyCourseFactoryTest, self).tearDown()69 super(NigeriaStudentStudyCourseFactoryTest, self).tearDown() 70 70 71 71 def test_interfaces(self): 72 verify.verifyClass(IFactory, CustomStudentStudyCourseFactory)72 verify.verifyClass(IFactory, NigeriaStudentStudyCourseFactory) 73 73 verify.verifyObject(IFactory, self.factory) 74 74 75 75 def test_factory(self): 76 76 obj = self.factory() 77 assert isinstance(obj, CustomStudentStudyCourse)77 assert isinstance(obj, NigeriaStudentStudyCourse) 78 78 79 79 def test_getInterfaces(self): 80 80 implemented_by = self.factory.getInterfaces() 81 assert implemented_by.isOrExtends(I CustomStudentStudyCourse)81 assert implemented_by.isOrExtends(INigeriaStudentStudyCourse) 82 82 83 class CustomStudentStudyLevelFactoryTest(FunctionalTestCase):83 class NigeriaStudentStudyLevelFactoryTest(FunctionalTestCase): 84 84 85 85 layer = FunctionalLayer 86 86 87 87 def setUp(self): 88 super( CustomStudentStudyLevelFactoryTest, self).setUp()89 self.factory = CustomStudentStudyLevelFactory()88 super(NigeriaStudentStudyLevelFactoryTest, self).setUp() 89 self.factory = NigeriaStudentStudyLevelFactory() 90 90 91 91 def tearDown(self): 92 super( CustomStudentStudyLevelFactoryTest, self).tearDown()92 super(NigeriaStudentStudyLevelFactoryTest, self).tearDown() 93 93 94 94 def test_interfaces(self): 95 verify.verifyClass(IFactory, CustomStudentStudyLevelFactory)95 verify.verifyClass(IFactory, NigeriaStudentStudyLevelFactory) 96 96 verify.verifyObject(IFactory, self.factory) 97 97 98 98 def test_factory(self): 99 99 obj = self.factory() 100 assert isinstance(obj, CustomStudentStudyLevel)100 assert isinstance(obj, NigeriaStudentStudyLevel) 101 101 102 102 def test_getInterfaces(self): 103 103 implemented_by = self.factory.getInterfaces() 104 assert implemented_by.isOrExtends(I CustomStudentStudyLevel)104 assert implemented_by.isOrExtends(INigeriaStudentStudyLevel) 105 105 106 class CustomCourseTicketFactoryTest(FunctionalTestCase):106 class NigeriaCourseTicketFactoryTest(FunctionalTestCase): 107 107 108 108 layer = FunctionalLayer 109 109 110 110 def setUp(self): 111 super( CustomCourseTicketFactoryTest, self).setUp()112 self.factory = CustomCourseTicketFactory()111 super(NigeriaCourseTicketFactoryTest, self).setUp() 112 self.factory = NigeriaCourseTicketFactory() 113 113 114 114 def tearDown(self): 115 super( CustomCourseTicketFactoryTest, self).tearDown()115 super(NigeriaCourseTicketFactoryTest, self).tearDown() 116 116 117 117 def test_interfaces(self): 118 verify.verifyClass(IFactory, CustomCourseTicketFactory)118 verify.verifyClass(IFactory, NigeriaCourseTicketFactory) 119 119 verify.verifyObject(IFactory, self.factory) 120 120 121 121 def test_factory(self): 122 122 obj = self.factory() 123 assert isinstance(obj, CustomCourseTicket)123 assert isinstance(obj, NigeriaCourseTicket) 124 124 125 125 def test_getInterfaces(self): 126 126 implemented_by = self.factory.getInterfaces() 127 assert implemented_by.isOrExtends(I CustomCourseTicket)127 assert implemented_by.isOrExtends(INigeriaCourseTicket)
Note: See TracChangeset for help on using the changeset viewer.