def test_bug_archived_software_release_access(self): """Checks that Computer has access to archived Software Release""" sequence_string = ( self.prepare_start_requested_computer_partition_sequence_string + """ LoginTestVifibDeveloper ArchiveSoftwareRelease Tic Logout SlapLoginCurrentComputer SoftwareInstanceStarted Tic SlapLogout LoginDefaultUser CheckComputerPartitionInstanceHostingSalePackingListStarted Logout LoginERP5TypeTestCase CheckSiteConsistency Logout """ ) sequence_list = SequenceList() sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_AdoptQuantityDivergenceOnInvoiceLineWithStoppedPackingList(self, quiet=quiet, run=RUN_ALL_TESTS): """Adopt quantity with stopped packing list""" if not run: return sequence_list = SequenceList() sequence = sequence_list.addSequenceString( self.PACKING_LIST_DEFAULT_SEQUENCE + \ """ stepStartPackingList stepStopPackingList stepTic stepInvoiceBuilderAlarm stepTic stepChangeQuantityDoubledOnInvoice stepTic stepCheckDivergedQuantityOnInvoice stepAdoptPrevisionOnInvoice stepTic """) sequence_list.play(self, quiet=quiet) packing_list = sequence.get('packing_list') invoice = packing_list.getCausalityRelatedValue() self.assertEquals([], invoice.getDivergenceList()) self.assertEquals('solved', invoice.getCausalityState()) self.assertEquals(1, len(invoice.getMovementList(portal_type=self.invoice_line_portal_type))) invoice_line = invoice.getMovementList(portal_type=self.invoice_line_portal_type)[0] self.assertEquals(99.0, invoice_line.getQuantity()) self.assertEquals(555.0, invoice_line.getPrice()) self.assertEquals(99.0, invoice_line.getDeliveryRelatedValue(portal_type='Simulation Movement' ).getQuantity()) self.assertEquals([], packing_list.getDivergenceList()) self.assertEquals('solved', packing_list.getCausalityState())
def test_computer_bang_not_called_on_destroying_destroyed(self): """Check that bang is ignoring destruction in progress and destroyed computer partitions""" self.computer_partition_amount = 1 sequence_list = SequenceList() sequence_string = self.prepare_destroy_requested_computer_partition + \ """ SlapLoginCurrentComputer CheckSuccessComputerGetComputerPartitionCall ComputerBang Tic SlapLogout SlapLoginCurrentComputer SoftwareInstanceDestroyed Tic SlapLogout LoginDefaultUser CheckComputerPartitionInstanceCleanupSalePackingListDelivered CheckComputerPartitionIsFree Logout SlapLoginCurrentComputer CheckSuccessComputerGetComputerPartitionCall ComputerBang Tic SlapLogout LoginERP5TypeTestCase CheckSiteConsistency Logout """ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_11_ManuallyAddedMovementsManyTransactions(self, quiet=quiet, run=RUN_ALL_TESTS): """ Checks that adding invoice lines and accounting lines generates correct simulation In this case checks what is happening, where movements are added in one transaction and edited in another """ if not run: return if not quiet: self.logMessage('Invoice with Manually Added Movements in separate transactions') sequence_list = SequenceList() sequence_list.addSequenceString( self.PACKING_LIST_DEFAULT_SEQUENCE + """ stepSetReadyPackingList stepTic stepStartPackingList stepCheckInvoicingRule stepTic stepInvoiceBuilderAlarm stepTic stepCheckInvoiceBuilding stepRebuildAndCheckNothingIsCreated stepCheckInvoicesConsistency stepTic stepCheckInvoiceIsSolved stepStartInvoice stepTic stepAddInvoiceLinesManyTransactions stepTic stepCheckSimulationTrees """) sequence_list.play(self, quiet=quiet)
def test_usageReportWithSinglePartition(self): """ Checks if useComputer method of SlapTool is properly called one time. """ self.computer_partition_amount = 1 self.purchase_packing_list_quantity = 1 self.sale_invoice_list_quantity = 1 self.sale_invoice_line_list_quantity = 2 self.sale_invoice_line_quantity = 42.42 sequence_list = SequenceList() sequence_string = \ self.prepare_configured_instance + \ self.prepare_reported_usage_call + """ \ LoginERP5TypeTestCase \ BuildSalePackingList \ Tic \ CheckCreatedSalePackingList \ CheckCompleteSalePackingList \ CheckSaleInvoiceExists \ CheckSaleInvoiceQuantitySinglePartition \ ClearModules \ Logout LoginERP5TypeTestCase CheckSiteConsistency Logout """ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_13_acceptQuantityDivergenceOnInvoiceWithStartedPackingList( self, quiet=quiet, run=RUN_ALL_TESTS): if not run: return if not quiet: self.logMessage('Accept Quantity Divergence on Invoice') sequence_list = SequenceList() sequence = sequence_list.addSequenceString( self.PACKING_LIST_DEFAULT_SEQUENCE + """ stepSetReadyPackingList stepTic stepStartPackingList stepTic stepInvoiceBuilderAlarm stepTic stepChangeQuantityDoubledOnInvoice stepTic stepCheckDivergedQuantityOnInvoice stepAcceptDecisionOnInvoice stepTic stepCheckDivergenceOnInvoice stepCheckDivergedOnPackingList stepCheckDivergedQuantityOnPackingList stepAdoptPrevisionOnPackingList stepTic """) sequence_list.play(self, quiet=quiet) packing_list = sequence.get('packing_list') invoice = packing_list.getCausalityRelatedValue(portal_type=self.invoice_portal_type) self.assertEquals('solved', packing_list.getCausalityState()) self.assertEquals('solved', invoice.getCausalityState())
def test_04_checkNotMergedTaskReportLine(self, quiet=0, run=run_all_test): """ Check that a task report can not be the created from a merged of multiple task lines. """ if not run: return sequence_list = SequenceList() sequence_string = 'stepLogin \ stepCreateOrganisation \ stepCreateOrganisation \ stepCreateResource \ stepCreateResource \ stepCreateSimpleTask \ stepSetTaskValues \ stepCreateTaskLine \ stepFillTaskLineWithData \ stepCreateTaskLine \ stepFillTaskLineWithData \ stepConfirmTask \ stepTic \ stepSetTaskReport \ stepVerifyMergedTaskLine \ stepStartTaskReport \ stepFinishTaskReport \ stepCloseTaskReport \ stepTic' sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_AcceptQuantityDivergenceOnInvoiceWithStoppedPackingList(self, quiet=quiet, run=RUN_ALL_TESTS): """Accept divergence with stopped packing list""" if not run: return sequence_list = SequenceList() sequence = sequence_list.addSequenceString( self.PACKING_LIST_DEFAULT_SEQUENCE + """ stepTic stepSetReadyPackingList stepTic stepStartPackingList stepStopPackingList stepTic stepInvoiceBuilderAlarm stepTic stepChangeQuantityDoubledOnInvoice stepTic stepCheckDivergedQuantityOnInvoice stepAcceptDecisionOnInvoice stepTic stepCheckDivergenceOnInvoice stepCheckSolvedOnPackingList """) sequence_list.play(self, quiet=quiet) packing_list = sequence.get('packing_list') self.assertEquals([], packing_list.getDivergenceList()) self.assertEquals('solved', packing_list.getCausalityState())
def test_Computer_getSoftwareReleaseList_twoPurchasePackingList(self): """ Check that calling Computer.getSoftwareReleaseList uses the Purchase Packing List in proper state, regardless its date """ sequence_list = SequenceList() sequence_string = self.prepare_two_purchase_packing_list + '\ SlapLoginCurrentComputer \ CheckSuccessComputerGetSoftwareReleaseListCall \ SlapLogout \ LoginDefaultUser \ StepPurchasePackingListBStartDateAfterPurchasePackingListA \ Tic \ Logout \ SlapLoginCurrentComputer \ CheckSuccessComputerGetSoftwareReleaseListCall \ SlapLogout \ LoginDefaultUser \ StepPurchasePackingListBStartDateBeforePurchasePackingListA \ Tic \ Logout \ SlapLoginCurrentComputer \ CheckSuccessComputerGetSoftwareReleaseListCall \ Tic \ SlapLogout \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_Computer_getSoftwareReleaseList_twoActivePurchasePackingList(self): """ Check that getSoftwareReleaseList only returns 1 software release if it is associated to 2 purchase packing list. """ sequence_list = SequenceList() sequence_string = \ self.prepare_software_release_purchase_packing_list + '\ LoginDefaultUser \ Tic \ CreatePurchasePackingList \ Tic \ CreatePurchasePackingListLine \ Tic \ SetPurchasePackingListLineSetupResource \ SetPurchasePackingListLineAggregate \ ConfirmPurchasePackingList \ Tic \ Logout \ SlapLoginCurrentComputer \ CheckSuccessComputerGetSoftwareReleaseListCall \ SlapLogout \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_01_IfNested(self, quiet=quiet): sequence_list = SequenceList() sequence = sequence_list.addSequenceString(self.DEFAULT_SEQUENCE) sequence_list.play(self, quiet=quiet) # order = sequence.get('order') # packing_list = sequence.get('packing_list') document = sequence.get('invoice') self.assertEquals('Sale Invoice Transaction', document.getPortalType()) line_list = document.objectValues( portal_type=self.portal.getPortalInvoiceMovementTypeList()) self.assertEquals(1, len(line_list)) line = line_list[0] self.assertEquals('Invoice Line', line.getPortalType()) self.assertEquals(None, line.getQuantity(None)) self.assertEquals(1, len(line)) line_line = line.objectValues()[0] self.assertEquals('Invoice Line', line_line.getPortalType()) self.assertEquals(self.default_price * self.default_quantity, document.getTotalPrice()) self.assertEquals(self.default_quantity, document.getTotalQuantity()) self.assertEquals(self.default_price, line_line.getPrice()) self.assertEquals(self.default_quantity, line_line.getQuantity())
def test_01_ERP5BankingMoneyDepositRendering(self, quiet=QUIET, run=RUN_ALL_TEST): """ Define the sequence of step that will be play """ if not run: return sequence_list = SequenceList() # define the sequence sequence_string = 'Tic CheckObjects Tic CheckInitialInventory CheckSource CheckDestination ' \ + 'CreateMoneyDepositRendering ' \ + 'Tic CheckBaobabDestination ' \ + 'CreateValidLine1 CheckSubTotal ' \ + 'CreateValidLine2 CheckTotal ' \ + 'CheckSource CheckDestination ' \ + 'CreateInvalidLine ' \ + 'TryOrderMoneyDepositRenderingWithBadInventory ' \ + 'DelInvalidLine Tic CheckTotal ' \ + 'OrderMoneyDepositRendering ' \ + 'Tic CheckSourceDebitPlanned CheckDestinationCreditPlanned ' \ + 'ResetInventory Tic ' \ + 'DeliverFails Tic ' \ + 'DeleteResetInventory Tic ' \ + 'DeliverMoneyDepositRendering ' \ + 'CheckSourceDebit CheckDestinationCredit ' sequence_list.addSequenceString(sequence_string) # play the sequence sequence_list.play(self)
def test_05_checkBackupWithTrashSubObjects(self, quiet=quiet, run=run_all_test): """ Test we can backup a tree like this : base_category/trash_folder/category """ if not run: return if not quiet: message = 'Test Check Backup With Trash Sub Object' ZopeTestCase._print('\n%s ' % message) LOG('Testing... ', 0, message) sequence_list = SequenceList() sequence_string = '\ CheckTrashToolExists \ CreateTrashBin \ CheckTrashBinIndexable \ AddBaseCategory \ AddCategories \ AddSubCategories \ Tic \ BackupObjectsWithSave \ Tic \ CheckObjectBackupWithoutSubObjects \ BackupSubCategories \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_01_ERP5BankingClassificationSurvey(self, quiet=QUIET, run=RUN_ALL_TEST): """ Define the sequence of step that will be play """ if not run: return sequence_list = SequenceList() # define the sequence sequence_string = 'Tic CheckObjects Tic CheckInitialInventory CheckSource CheckDestination ' \ + 'CreateClassificationSurvey ' \ + 'CreateTwoValidIncomingLine CheckSubTotal ' \ + 'CreateValidOutgoingLineForInternalBanknote ' \ + 'CreateValidOutgoingLineForExternalBanknote ' \ + 'Tic CheckTotal ' \ + 'CheckSource CheckDestination ' \ + 'ConfirmClassificationSurvey Tic ' \ + 'CheckSourceDebitPlanned CheckDestinationCreditPlanned ' \ + 'ResetSourceInventory Tic ' \ + 'DeliverClassificationSurveyFails Tic ' \ + 'DeleteResetInventory Tic ' \ + 'DeliverClassificationSurvey Tic ' \ + 'CheckSourceDebit CheckDestinationCredit ' sequence_list.addSequenceString(sequence_string) # play the sequence sequence_list.play(self)
def test_05_testStrictSimulationSecurity(self, quiet=0, run=run_all_test): """Test creation of task and (automatic) task_report with strict security in the simulation. """ if not run: return sequence_list = SequenceList() sequence_string = self.default_task_sequence + '\ stepVerifyGeneratedByBuilderTaskReport \ stepStartTaskReport \ stepFinishTaskReport \ stepCloseTaskReport \ stepTic' sequence_list.addSequenceString(sequence_string) simulation_tool = self.getPortal().portal_simulation uf = self.getPortal().acl_users if not uf.getUser('manager'): uf._doAddUser('manager', '', ['Manager'], []) self.login('manager') try: simulation_tool.Base_setDefaultSecurity() self.logout() sequence_list.play(self) finally: self.login('manager') for permission in simulation_tool.possible_permissions(): simulation_tool.manage_permission(permission, roles=(), acquire=1) self.logout()
def test_01_getAggregatedAmountList(self, quiet=0, run=run_all_test): """ Test the method getAggregatedAmountList """ if not run: return sequence_list = SequenceList() # Test with a simply order without cell sequence_string = '\ CreateComponentDict \ CreateOperationDict \ Tic \ CreateVariatedResource \ Tic \ CreateTransformation \ Tic \ CreateTransformationLine \ Tic \ CreateIncludedTransformation \ Tic \ CreateIncludedTransformationLine \ Tic \ VerifyTransformationAggregatedAmountList \ VerifyIncludedTransformationAggregatedAmountList \ IncludeTransformation \ Tic \ VerifySpecialisedTransformationAggregatedAmountList \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_03_TaskReportChangeStartDate(self, quiet=quiet, run=run_all_test): """ Test generation of delivery list """ if not run: return sequence_list = SequenceList() # Test with a simply order without cell sequence_string = '\ stepSetStrictSecurity \ ' + self.default_task_sequence + '\ stepCheckTaskReportIsSolved \ stepChangeCommentOnTaskReport \ stepChangeTaskReportStartDate \ stepCheckTaskReportIsCalculating \ stepTic \ stepCheckTaskReportIsDiverged \ stepAcceptDateDecision \ stepTic \ stepCheckTaskReportIsSolved \ stepCheckCommentStillOnTaskReport \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_04_TaskReportChangeStartDate(self, quiet=quiet, run=run_all_test): """ Check that it is possible to solve date's divergence on the task report line level. """ if not run: return sequence_list = SequenceList() # Test with a simply order without cell sequence_string = '\ stepSetStrictSecurity \ ' + self.default_task_sequence + '\ stepCheckTaskReportIsSolved \ \ stepCloneTaskReportLine \ stepChangeFirstTaskReportLineDate \ stepChangeSecondTaskReportLineDate \ stepCheckTaskReportIsCalculating \ stepTic \ stepCheckTaskReportIsDiverged \ stepAcceptLineDateDecision \ stepTic \ stepCheckTaskReportIsSolved \ stepCheckTaskReportDates \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_sentMailMessageCreateOneInternetMessagePostForEachRecipient(self): """ In case of multi recipients for emails, one mail message content is generated and sent through the MailHost. As the purpose of Internet Message Post is to track what goes out of ERP5, one Internet Message Post must be created for each of these mail message contents. """ recipient_2 = self.portal.person_module.newContent( portal_type='Person', title='recipient_2', default_email_coordinate_text='*****@*****.**', ) self.recipient_list.append(recipient_2) sequence_list = SequenceList() sequence_string = """ stepCreateMailMessage stepStartMailMessage stepCheckMailMessage stepTic stepCheckInternetMessagePostCreated stepCheckLatestMessageListFromMailHost """ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_14_ManuallyAddPackingListWithItem(self, quiet=quiet, run=run_all_test): """ Checks that adding invoice lines and accounting lines to one invoice generates correct simulation """ if not quiet: self.logMessage('Invoice with Manually Added Movements') sequence_list = SequenceList() sequence_string = self.DEFAULT_ITEM_WITH_PACKING_LIST_SEQUENCE + '\ stepSetReadyPackingList \ stepTic \ stepStartPackingList \ stepCheckInvoicingRule \ stepTic \ stepInvoiceBuilderAlarm \ stepTic \ stepCheckInvoiceBuilding \ stepRebuildAndCheckNothingIsCreated \ stepCheckInvoicesConsistency \ stepAddInvoiceLines \ stepTic \ stepStartInvoice \ stepTic \ stepCheckSimulationTrees \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_15_ThreeOrderLines(self, quiet=quiet, run=run_all_test): """ Check that item with three order lines. """ sequence_list = SequenceList() sequence_string = self.DEFAULT_ITEM_WITH_ORDER_SEQUENCE + '\ stepCreateItemList \ stepCreateOrderLine \ stepSetOrderLineResource \ stepSetOrderLineDefaultValues \ stepCreateItemList \ stepCreateOrderLine \ stepSetOrderLineResource \ stepSetOrderLineDefaultValues \ stepOrderSetAggregationList \ stepTic \ stepOrderOrder \ stepTic \ stepConfirmOrder \ stepTic \ stepPackingListBuilderAlarm \ stepTic \ stepCheckOrderSimulation \ stepCheckDeliveryBuilding \ stepCheckPackingListIsNotDivergent \ stepCheckPackingListLineAggregateList \ stepCheckOrderPackingList ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_03_ImportNoMapping(self): sequence_list = SequenceList() step_list = [ 'stepImportFileNoMapping' ] sequence_string = ' '.join(step_list) sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_01_ItemSimpleTest(self, quiet=quiet): sequence_list = SequenceList() # Test with a simply order without cell sequence_string = 'stepCreateOrganisation1 \ stepCreateOrganisation2 \ stepCreateOrganisation3 \ stepCreateItemList \ stepCreateOrder \ stepSetOrderProfile \ stepCreateNotVariatedResource \ stepTic \ stepCreateOrderLine \ stepSetOrderLineResource \ stepSetOrderLineDefaultValues \ stepOrderLineSetAggregationList \ stepConfirmOrder \ stepTic \ stepPackingListBuilderAlarm \ stepTic \ stepCheckOrderLineAggregate \ stepCheckOrderSimulation \ stepCheckSimulationAggregate \ stepCheckDeliveryBuilding \ stepCheckPackingListLineAggregate \ stepCheckPackingListIsNotDivergent ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_10_ManuallyAddedMovements(self, quiet=quiet, run=RUN_ALL_TESTS): """ Checks that adding invoice lines and accounting lines to one invoice generates correct simulation """ if not run: return if not quiet: self.logMessage('Invoice with Manually Added Movements') sequence_list = SequenceList() sequence_list.addSequenceString( self.PACKING_LIST_DEFAULT_SEQUENCE + """ stepSetReadyPackingList stepTic stepStartPackingList stepCheckInvoicingRule stepTic stepInvoiceBuilderAlarm stepTic stepCheckInvoiceBuilding stepRebuildAndCheckNothingIsCreated stepCheckInvoicesConsistency stepStartInvoice stepTic stepAddInvoiceTransactionLines stepTic stepCheckSimulationTrees """) sequence_list.play(self, quiet=quiet)
def test_02_InvoiceDeletePackingListLine(self, quiet=quiet, run=RUN_ALL_TESTS): """ Checks that deleting a Packing List Line still creates a correct Invoice """ if not run: return if not quiet: self.logMessage('Packing List Line Delete') sequence_list = SequenceList() for base_sequence in (self.PACKING_LIST_TWO_LINES_DEFAULT_SEQUENCE, ) : sequence_list.addSequenceString( base_sequence + """ stepDeletePackingListLine stepSetReadyPackingList stepTic stepStartPackingList stepCheckInvoicingRule stepTic stepInvoiceBuilderAlarm stepTic stepCheckInvoiceBuilding stepRebuildAndCheckNothingIsCreated stepCheckInvoicesConsistency """) sequence_list.play(self, quiet=quiet)
def test_01_TwoInvoicesFromTwoPackingList(self, quiet=quiet, run=RUN_ALL_TESTS): """ This test was created for the following bug: - an order is created and confirmed - the packing list is split - the 2 packing list are delivered (at different date) - 2 invoices are built, then we set the same date on both of them - the accounting rules are generated and put in only one invoice !!, so we have an invoice with twice the number of accounting rules and an invoice with no accounting rules. both invoices are wrong """ if not run: return if not quiet: self.logMessage('Two Invoices from Two Packing List') sequence_list = SequenceList() sequence_list.addSequenceString( self.TWO_PACKING_LIST_DEFAULT_SEQUENCE + """ stepSetReadyPackingList stepSetReadyNewPackingList stepTic stepStartPackingList stepStartNewPackingList stepTic stepInvoiceBuilderAlarm stepTic stepCheckTwoInvoices stepRemoveDateMovementGroupForAdvancedTransactionBuilder stepStartTwoInvoices stepTic stepCheckInvoicesAndTransactionsConsistency """) sequence_list.play(self, quiet=quiet)
def test_02_AdoptingPrevision(self, quiet=quiet): sequence_list = SequenceList() sequence = sequence_list.addSequenceString(self.DEFAULT_SEQUENCE + \ """ stepUpdatePackingList stepTic stepAcceptDecisionPackingListQuantity stepTic stepCheckInvoiceIsDivergent stepCheckInvoiceIsDiverged stepAdoptPrevisionInvoiceQuantity stepTic """ ) sequence_list.play(self, quiet=quiet) document = sequence.get('invoice') self.assertEquals('solved', document.getCausalityState()) line_list = document.objectValues( portal_type=self.portal.getPortalInvoiceMovementTypeList()) self.assertEquals(1, len(line_list)) line = line_list[0] self.assertEquals('Invoice Line', line.getPortalType()) self.assertEquals(None, line.getQuantity(None)) self.assertEquals(1, len(line)) line_line = line.objectValues()[0] self.assertEquals('Invoice Line', line_line.getPortalType()) self.assertEquals(self.default_price * self.new_packing_list_quantity, document.getTotalPrice()) self.assertEquals(self.new_packing_list_quantity, document.getTotalQuantity()) self.assertEquals(self.new_packing_list_quantity, line_line.getQuantity())
def test_request_new_with_destroyed_reference_web_ui(self): """Prove that having destroyed SI allows to request new one with same reference Supports web UI case. """ sequence_list = SequenceList() sequence_string = ( "SetSoftwareTitleRandom" + self.prepare_destroyed_computer_partition + """ LoginTestVifibCustomer SetSequenceSoftwareInstanceStateStopped PersonRequestSoftwareInstance Tic Logout LoginDefaultUser CallConfirmOrderedSaleOrderAlarm Tic SetSelectedComputerPartition SelectCurrentlyUsedSalePackingListUid Logout LoginDefaultUser CheckComputerPartitionInstanceSetupSalePackingListDelivered Logout LoginERP5TypeTestCase CheckSiteConsistency Logout """ ) sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_01_ERP5BankingCashInventory(self, quiet=QUIET, run=RUN_ALL_TEST): """ Define the sequence of step that will be play """ if not run: return sequence_list = SequenceList() # define the sequence sequence_string = ( "Tic CheckObjects Tic CheckInitialInventory " + "CreateCashInventoryGroup CreateCashInventory " + "CreateInventoryLine1 CheckSubTotal1 " + "CreateInventoryLine2 CheckSubTotal2 " + "CreateInventoryLine3 CheckTotal " + "CheckInventoryDelivered Tic CheckInventory " + "CreateCashInventoryGroup2 CreateCashInventory " + "CreateInventoryLine1 CheckSubTotal1 " + "CreateInventoryLine2 CheckSubTotal2 " + "CreateInventoryLine3 CheckTotal " + "CheckInventoryDelivered Tic CheckInventory" ) sequence_list.addSequenceString(sequence_string) # play the sequence sequence_list.play(self)
def test_hosting_subscription_security_on_partition_with_destroyed(self): """Checks that history of Computer Partition does not impacts its security configuration""" sequence_list = SequenceList() sequence_string = ( self.prepare_destroyed_computer_partition + """ LoginDefaultUser CheckComputerPartitionInstanceSetupSalePackingListDelivered CheckComputerPartitionInstanceHostingSalePackingListDelivered CheckComputerPartitionInstanceCleanupSalePackingListDelivered # Marked busy in order to simulate previous wrong behaviour MarkBusyComputerPartition Tic UpdateLocalRolesOnComputerPartition Tic # All related packing lists are delivered, so no local roles for # Hosting Subscription shall be defined CheckNoHostingSubscriptionComputerPartitionLocalRoles Logout LoginERP5TypeTestCase CheckSiteConsistency Logout """ ) sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_can_run_upgrade_without_solve_pre_upgrade(self): """Check that if there is something to solve in pre_upgrade is still possible run only the upgrade step directly (eventhough this does not really make sense)""" sequence_list = SequenceList() sequence_string = """ stepCreatePerson stepCreateScriptCheckPreUpgradeReferenceConsistency stepCreatePersonPropertySheet stepSetConstraintInPersonPortalType stepUninstallERP5Web stepTic stepActiveSensePreUpgradeAlarm stepTic stepRunUpgrader stepTic stepCheckPreUpgradeRequired """ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_can_not_run_upgrade_without_solve_pre_upgrade(self): """Check that if there is something to solve in pre_upgrade is not possible run the upgrade""" sequence_list = SequenceList() sequence_string = """ stepCreatePerson stepCreateScriptCheckPreUpgradeReferenceConsistency stepCreatePersonPropertySheet stepSetConstraintInPersonPortalType stepUninstallERP5Web stepTic stepActiveSensePreUpgradeAlarm stepTic stepRunUpgrader stepTic stepCheckSummaryForPreUpgradeRequired """ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_03_deadProxyField(self): """ Create an business template with a skin folder containing a Field Library. Add a form to the skin folder. Add a dead proxy field inside this form. Check that the 'Manage Field Library' detects this dead proxy field. """ sequence_list = SequenceList() sequence_string = '\ CreateSkinFolder \ CreateFieldLibrary \ CreateForm \ CreateDeadProxyField \ CreateNewBusinessTemplate \ CheckDeadFieldDetection \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_02_notProxifiedField(self): """ Create an business template with a skin folder containing a Field Library. Add a form to the skin folder. Add a not proxified field inside this form. Check that the 'Manage Field Library' action propose to proxify the field. """ sequence_list = SequenceList() sequence_string = '\ CreateSkinFolder \ CreateFieldLibrary \ CreateForm \ CreateNotProxifiedField \ CreateNewBusinessTemplate \ CheckToProxifyField \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_04_checkBackupWithSubObjects(self, quiet=quiet, run=run_all_test): if not run: return if not quiet: message = 'Test Check Backup Without Subobjects' ZopeTestCase._print('\n%s ' % message) LOG('Testing... ', 0, message) sequence_list = SequenceList() sequence_string = '\ CheckTrashToolExists \ CreateTrashBin \ AddBaseCategory \ AddCategories \ Tic \ BackupObjectsWithKeepingSubobjects \ Tic \ CheckObjectBackupWithSubObjects \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_not_post_many_active_result_when_upgrade(self): """ Check that is possible fix consistency before the upgrade""" sequence_list = SequenceList() sequence_string = """ stepCreatePerson stepCreatePerson stepTic stepCreateScriptCheckPreUpgradeReferenceConsistency stepCreatePersonPropertySheet stepSetConstraintInPersonPortalType stepActiveSensePreUpgradeAlarm stepTic stepCheckPersonPreUpgradeConstraintList stepRunPreUpgrade stepTic stepCheckPersonPreUpgradeConstraintListAfterUpgrade """ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_01_ERP5BankingMoneyDeposit(self, quiet=QUIET, run=RUN_ALL_TEST): """ Define the sequence of step that will be play """ if not run: return sequence_list = SequenceList() # define the sequence sequence_string = 'Tic CheckObjects Tic CheckInitialInventory ' \ + 'CreateMoneyDeposit Tic ' \ + 'MoneyDepositSendToValidation Tic ' \ + 'MoneyDepositSendToCounter Tic ' \ + 'MoneyDepositInputCashDetails ' \ + 'CheckConfirmedInventory Tic ' \ + 'DeliverMoneyDeposit Tic ' \ + 'CheckFinalInventory' sequence_list.addSequenceString(sequence_string) # play the sequence sequence_list.play(self)
def test_01_ERP5BankingBankAccountInventory(self, quiet=QUIET, run=RUN_ALL_TEST): """ Define the sequence of step that will be play """ if not run: return sequence_list = SequenceList() # define the sequence sequence_string = 'Tic CheckInitialInventory ' \ + 'CreateBankAccountInventoryGroup ' \ + 'CreateBankAccountInventory ' \ + 'CreateBankAccountInventoryLine ' \ + 'CheckFinalInventory' sequence_list.addSequenceString(sequence_string) # play the sequence sequence_list.play(self)
def testPurchasePackingList(self): sequence_list = SequenceList() sequence_str = """ TestPurchasePackingList_create Tic SelectPurchasePackingList1 ConfirmPurchasePackingList Tic StartPurchasePackingList Tic StopPurchasePackingList Tic CallBuilder Tic CheckThreeAccountingTransactionGeneratedFromPurchasePackingList TestPurchasePackingList_checkAllAccountingTransaction """ sequence_list.addSequenceString(sequence_str) sequence_list.play(self, quiet=0)
def test_02_maxDelayResourceOrderBuilder(self, quiet=0, run=run_all_test): """ Test max_delay impact on generated order start date """ if not run: return self.max_delay = 4.0 self.wanted_quantity = 1.0 self.wanted_start_date = DateTime( str(self.datetime - self.max_delay + self.order_builder_hardcoded_time_diff)) self.wanted_stop_date = DateTime( str(self.datetime + self.order_builder_hardcoded_time_diff)) sequence_list = SequenceList() sequence_list.addSequenceString(self.common_sequence_string) sequence_list.play(self)
def test_02_splitAndDeferAfterAcceptDecision(self, quiet=quiet, run=run_all_test): """ Change the quantity on an delivery line, then see if the packing list is divergent and then accept decision, then change the quantity again and see if the packing list is divergent and then split and defer the packing list and then see if two packing lists has correct quantity and they are not diverged. """ if not run: return sequence_list = SequenceList() # Test with a simply order without cell sequence_string = self.default_sequence + '\ stepIncreasePackingListLineQuantity1000 \ stepChangePackingListDestination \ stepCheckPackingListIsCalculating \ stepTic \ stepCheckPackingListIsDiverged \ stepAcceptDecisionDestination \ stepAcceptDecisionQuantity \ stepCheckPackingListIsCalculating \ stepTic \ stepCheckPackingListIsNotDivergent \ stepCheckPackingListIsSolved \ stepDecreasePackingListLineQuantity10 \ stepCheckPackingListIsCalculating \ stepTic \ stepCheckPackingListIsDiverged \ stepSplitAndDeferPackingList \ stepCheckSolverIsSolving \ stepTic \ stepCheckPackingListSplittedForTest02 \ stepCheckPackingListIsSolved \ stepCheckSolverIsSolved \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def testInternalPackingList(self): sequence_list = SequenceList() sequence_str = """ TestInternalPackingList_create Tic SelectInternalPackingList1 ConfirmInternalPackingList Tic StartInternalPackingList Tic StopInternalPackingList Tic CallBuilder Tic CheckTwoAccountingTransactionGeneratedFromInternalPackingList TestInternalPackingList_checkAllAccountingTransaction """ sequence_list.addSequenceString(sequence_str) sequence_list.play(self, quiet=0)
def test_01_ERP5BankingMonetaryReception(self, quiet=QUIET, run=RUN_ALL_TEST): """ Define the sequence of step that will be play """ if not run: return sequence_list = SequenceList() # define the sequence sequence_string = 'Tic CheckObjects Tic CheckInitialInventory CheckInitialContainerInventory ' \ + 'CreateMonetaryReception Tic ' \ + 'CreateCashContainer Tic CheckCashDeliveryLine ' \ + 'CheckCashContainer1 CheckCashContainer2 ' \ + 'ConfirmMonetaryReception Tic CheckConfirmedInventory CheckConfirmedContainerInventory ' \ + 'DeliverMonetaryReception Tic CheckFinalInventory CheckFinalContainerInventory' sequence_list.addSequenceString(sequence_string) # play the sequence sequence_list.play(self)
def test_11_ChangeOrderQuantityAndAcceptOnPackingList(self, quiet=quiet, run=run_all_test): """ Create order and add items, then Change the quantity on an order line, after that see if the packing list is divergent and then accept decision on the packing list """ sequence_list = SequenceList() sequence_string = self.DEFAULT_ITEM_WITH_PACKING_LIST_SEQUENCE + '\ stepModifyOrderLinesQuantity \ stepTic \ stepCheckPackingListIsDiverged \ stepAcceptDecisionQuantity \ stepTic \ stepCheckPackingListIsNotDivergent \ stepCheckPackingListIsSolved \ stepCheckSimulationQuantityUpdated \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_04_ReturnedSalePackingListCreating(self, quiet=quiet, run=run_all_test): """ Test that returned sale packing List creating """ if not run: return sequence_list = SequenceList() sequence_string = self.default_sequence + '\ stepTic \ stepCreateReturnedPackingList \ stepTic \ stepCheckReturnedPackingListCreating \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_07_WithPackingListChangePackingListQuantityAndAccept(self, quiet=quiet, run=run_all_test): """ Create order and add items, then Change the quantity on an delivery line, after that see if the packing list is divergent and then split and defer the packing list """ sequence_list = SequenceList() sequence_string = self.DEFAULT_ITEM_WITH_PACKING_LIST_SEQUENCE + '\ stepDecreasePackingListLineQuantity \ stepCheckPackingListIsCalculating \ stepTic \ stepCheckPackingListIsDiverged \ stepSplitAndDeferPackingList \ stepTic \ stepCheckPackingListIsSolved \ stepCheckPackingListSplitted \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_sense_full_upgrade_do_not_sense_post_upgrade(self): """ Check that the post-upgrade consistency check is not run when running the activeSense method of the full-upgrade alarm, as post-upgrade will give inconsistent result """ sequence_list = SequenceList() sequence_string = """ stepRunUpgrader stepTic stepCreatePerson stepValidatePerson stepSetConstraintInPersonModulePortalType stepTic stepCheckFullUpgradeNotRequired stepCheckPostUpgradeRequired """ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_01_ERP5BankingAccountingCancellation(self, quiet=QUIET, run=RUN_ALL_TEST): """ Define the sequence of step that will be play """ if not run: return sequence_list = SequenceList() # define the sequence sequence_string = 'Tic CheckInitialInventory ' \ 'CreateAccountingCancellation Tic ' \ 'AddAccountingCancellationLine Tic ' \ 'OrderAccountingCancellation ' \ 'ConfirmAccountingCancellation Tic ' \ 'CheckConfirmedInventory Tic ' \ 'DeliverAccountingCancellation Tic ' \ 'CheckFinalInventory Tic' sequence_list.addSequenceString(sequence_string) # play the sequence sequence_list.play(self)
def test_06_checkBackupofOFSFolderWithSave(self, quiet=quiet, run=run_all_test): if not run: return if not quiet: message = 'Test Check Backup Of OFS Folder With Save' ZopeTestCase._print('\n%s ' % message) LOG('Testing... ', 0, message) sequence_list = SequenceList() sequence_string = '\ CheckTrashToolExists \ CreateTrashBin \ CheckTrashBinIndexable \ AddFolder \ Tic \ BackupFolderObjectsWithSave \ Tic \ CheckFolderObjectBackup \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_08_openResolvedBug(self, quiet=QUIET, run=RUN_ALL_TEST): """ Test that a bug is resolved, we can still reopen it """ if not run: return sequence_list = SequenceList() step_list = [ 'stepCreateBug' , 'stepCheckBugInit' , 'stepOpenBug' , 'stepTic' , 'stepAssignBug' , 'stepTic' , 'stepResolveBug' , 'stepTic' , 'stepOpenBug' , 'stepTic' ] sequence_string = ' '.join(step_list) sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_09_ChangeOrderDateAndAcceptOnPackingList(self, quiet=quiet, run=run_all_test): """ Create order and add items, then Change the order date on an order line, after that see if the packing list is divergent and then adopt prevision on the packing list """ sequence_list = SequenceList() sequence_string = self.DEFAULT_ITEM_WITH_PACKING_LIST_SEQUENCE + '\ stepModifyOneOrderLineStartDate \ stepTic \ stepCheckPackingListIsDiverged \ stepCheckPackingListIsDivergent \ stepUnifyStartDateWithPrevision \ stepTic \ stepCheckPackingListIsNotDivergent \ stepCheckPackingListIsSolved \ stepCheckNewPackingListAfterStartDateAdopt \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_05_wrongProxification(self): """ Create an business template with a skin folder containing a Field Library. Add a form to the skin folder. Add a proxy field (inside this form) linking to another Field Library. Check that the 'Manage Field Library' detects this wrong proxification. """ sequence_list = SequenceList() sequence_string = '\ CreateSkinFolder \ CreateFieldLibrary \ CreateForm \ CreateWronglyProxifiedField \ CreateNewBusinessTemplate \ CheckWrongProxificationDetection \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_Entity_sendEmailCanRaiseOnceWithoutSpammingRecipient(self): """ Entity_sendEmail used to be launched in an activity with retry_max=0 and retry_conflict=False. But now that it creates Internet Message Posts, it should be able to retry on ConflictError. We should also make sure that in this case the mail isn't sent (as MailHost isn't transactional) """ sequence_list = SequenceList() sequence_string = """ stepMakeEntitySendEmailFailOnce stepCreateMailMessage stepStartMailMessage stepCheckMailMessage stepTic stepCheckInternetMessagePostCreated stepCheckOnlyOneMessageHasBeenSentFromMailHost stepCheckLatestMessageListFromMailHost """ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_12_CreteSameResourceDifferentItemOrderLines(self, quiet=quiet, run=run_all_test): """ Create order lines with same resouces and add items into them, then Change the quantity on the order lines, after that see if the packing list is divergent and then adopt prevision on the packing list """ sequence_list = SequenceList() sequence_string = '' sequence_string = self.DEFAULT_ITEM_WITH_PACKING_LIST_SEQUENCE_AND_SAME_RESOURCE_LINES + '\ stepModifyOrderLinesQuantity \ stepTic \ stepCheckPackingListIsDiverged \ stepAdoptPrevisionQuantity \ stepTic \ stepCheckPackingListIsNotDivergent \ stepCheckPackingListIsSolved \ stepCheckPackingListLineWithNewQuantityPrevision \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_05_ClonedTaskReportWorkflowEvolution(self, quiet=quiet, run=run_all_test): """ """ if not run: return sequence_list = SequenceList() # Test with a simply order without cell sequence_string = '\ stepSetStrictSecurity \ ' + self.default_task_sequence + '\ stepCheckTaskReportIsSolved \ \ stepCloneTaskReportAndDoWfTransitions \ ' sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet)
def test_01_checkPasswordTool(self): sequence_list = SequenceList() sequence_string = 'CheckPasswordToolExists ' \ 'AddUser Tic ' \ 'Logout ' \ 'CheckUserLogin CheckUserNotLoginWithBadPassword ' \ 'TryLostPasswordWithBadUser Tic ' \ 'CheckNoMailSent ' \ 'GoToBadRandomAddress Tic ' \ 'CheckUserLogin CheckUserNotLoginWithBadPassword ' \ 'LostPassword Tic ' \ 'CheckMailSent GoToRandomAddress Tic ' \ 'CheckUserLoginWithNewPassword ' \ 'CheckUserNotLoginWithFormerPassword ' \ 'GoToRandomAddressTwice Tic ' \ 'CheckUserLoginWithNewPassword ' \ 'CheckUserNotLoginWithFormerPassword ' \ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_01a_simpleOrderBuilderVariatedResource(self, quiet=0, run=run_all_test): """ Test simple Order Builder for Variated Resource """ if not run: return sequence_string = """ CreateOrganisation CreateVariatedResource SetMaxDelayOnResource SetMinFlowOnResource Tic DecreaseOrganisationResourceQuantityVariated Tic CreateOrderBuilder FillOrderBuilder Tic BuildOrderBuilder Tic CheckGeneratedDocumentListVariated """ self.wanted_quantity = 1.0 self.wanted_start_date = DateTime( str(self.datetime.earliestTime() + self.order_builder_hardcoded_time_diff)) self.wanted_stop_date = self.wanted_start_date self.decrease_quantity_matrix = { 'size/Man': 1.0, 'size/Woman': 2.0, } self.wanted_quantity_matrix = self.decrease_quantity_matrix.copy() sequence_list = SequenceList() sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_rename_category(self): """Check that the renaming category feature correctly updates objects""" sequence_list = SequenceList() sequence_string = """ stepCreateOrganisationWithActivity stepCreateCustomUpgradeCategoryListForRenaming stepUpdateOrganisationPropertySheetManually stepTic stepActiveSensePreUpgradeAlarm stepActiveSensePostUpgradeAlarm stepTic stepRunUpgrader stepRenameCategoryActivityToBusinessCore stepTic stepRunPostUpgrade stepTic stepCheckOrganisationObjectUpdatedAfterCategoryRenaming stepRemoveCustomUpgradeCategoryList """ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_can_run_post_upgrade_without_solve_upgrade(self): """Check that if there is something to solve in upgrade, it is still possible to run the post upgrade step directly.""" sequence_list = SequenceList() sequence_string = """ stepUninstallERP5Web stepSetConstraintInPersonModulePortalType stepTic stepCheckUpgradeRequired stepCheckPostUpgradeNotRequired stepCreatePerson stepValidatePerson stepTic stepCheckPostUpgradeRequired stepRunPostUpgrade stepTic stepCheckUpgradeRequired stepCheckPostUpgradeNotRequired """ sequence_list.addSequenceString(sequence_string) sequence_list.play(self)
def test_01_ERP5BankingCheckbookDelivery(self, quiet=QUIET, run=RUN_ALL_TEST): """ Define the sequence of step that will be play """ if not run: return sequence_list = SequenceList() # define the sequence sequence_string = 'Tic CheckObjects Tic CheckInitialCheckbookInventory ' \ + 'CreateCheckbookDelivery Tic ' \ + 'CreateCheckAndCheckbookLineList Tic ' \ + 'ChangePreviousDeliveryDate Tic ' \ + 'DeliverCheckbookDeliveryFails Tic ' \ + 'PutBackPreviousDeliveryDate Tic ' \ + 'DeliverCheckbookDelivery Tic ' \ + 'CheckFinalCheckbookInventory' sequence_list.addSequenceString(sequence_string) # play the sequence sequence_list.play(self)