Esempio n. 1
0
 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)
Esempio n. 2
0
  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)
Esempio n. 3
0
 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_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)
Esempio n. 5
0
  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)
Esempio n. 6
0
  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)
Esempio n. 7
0
 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_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_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)
Esempio n. 10
0
  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_ComputerPartition_error_twoSalePackingList(self):
   """
   Check that calling ComputerPartition.error uses the latest sale packing
   list for calculation
   """
   sequence_list = SequenceList()
   sequence_string = self.prepare_start_requested_computer_partition_sequence_string + '\
     LoginDefaultUser \
     SetHostingAfterSetupStartDate \
     Tic \
     Logout \
     SlapLoginCurrentComputer \
     CheckSuccessComputerPartitionErrorCall \
     Tic \
     LoginDefaultUser \
     CheckSalePackingListNoErrorText \
     SetHostingBeforeSetupStartDate \
     Tic \
     Logout \
     SlapLoginCurrentComputer \
     CheckSuccessComputerPartitionErrorCall \
     Tic \
     SlapLogout \
     LoginDefaultUser \
     CheckSalePackingListErrorText \
     Logout \
     LoginERP5TypeTestCase \
     CheckSiteConsistency \
     Logout \
   '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 12
0
    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_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_ComputerPartition_error_CleanupResource_DeliveredState(self):
   """
   Check that calling ComputerPartition.error works in
   delivered state with the cleanup resource
   """
   sequence_list = SequenceList()
   sequence_string = self.prepare_confirmed_cleanup_resource_packing_list + '\
     LoginDefaultUser \
     StartSalePackingList \
     CleanTic \
     StopSalePackingList \
     CleanTic \
     DeliverSalePackingList \
     Tic \
     Logout \
     SlapLoginCurrentComputer \
     CheckSuccessComputerPartitionErrorCall \
     CleanTic \
     SlapLogout \
     LoginDefaultUser \
     CheckSalePackingListErrorText \
     CheckDeliveredSalePackingList \
     Logout \
     LoginERP5TypeTestCase \
     CheckSiteConsistency \
     Logout \
   '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 15
0
 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_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)
Esempio n. 17
0
 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)
Esempio n. 18
0
 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)
Esempio n. 19
0
  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)
Esempio n. 20
0
    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_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)
Esempio n. 22
0
  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)
Esempio n. 23
0
  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_ComputerPartition_error_AccountingResource_DeliveredState(self):
   """
   Check that calling ComputerPartition.error works in 
   delivered state with the accounting resource
   """
   sequence_list = SequenceList()
   sequence_string = self.prepare_computer_partition_accounting_resource_sequence_string + '\
     LoginDefaultUser \
     StartSalePackingList \
     CleanTic \
     StopSalePackingList \
     CleanTic \
     DeliverSalePackingList \
     Tic \
     Logout \
     SlapLoginCurrentComputer \
     CheckSoftwareReleaseErrorCall \
     Tic \
     SlapLogout \
     LoginDefaultUser \
     CheckSalePackingListNoErrorText \
     CheckDeliveredSalePackingList \
     SelectCurrentlyUsedSalePackingListUid \
     CheckSalePackingListErrorText \
     Logout \
     LoginERP5TypeTestCase \
     CheckSiteConsistency \
     Logout \
   '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 25
0
  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_ComputerPartition_error_afterRegister(self):
   """
   Check that calling ComputerPartition.error after just registration raises a
   NotFoundError
   """
   sequence_list = SequenceList()
   sequence_string = '\
     LoginTestVifibAdmin \
     CustomerRegisterNewComputer \
     Tic \
     SetComputerCoordinatesFromComputerTitle \
     ComputerSetAllocationScopeOpenPublic \
     Tic \
     Logout \
     SlapLoginCurrentComputer \
     FormatComputer \
     Tic \
     SlapLogout \
     Tic \
     SlapLoginCurrentComputer \
     CheckNotFoundComputerPartitionErrorAfterRegisterCall \
     CleanTic \
     SlapLogout \
     LoginERP5TypeTestCase \
     CheckSiteConsistency \
     Logout \
   '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 27
0
  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)
Esempio n. 28
0
  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()
Esempio n. 29
0
 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_ERP5BankingCheckbookReception(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 ' \
                    + 'CreateCheckbookReception Tic ' \
                    + 'CreateCheckAndCheckbookLineList Tic ' \
                    + 'ConfirmCheckbookReception Tic ' \
                    + 'DeliverCheckbookReception Tic ' \
                    + 'CheckItemsCreated  ' \
                    + 'CheckFinalCheckbookInventory'
    sequence_list.addSequenceString(sequence_string)

    # Make sure it is impossible to create a checkbook with a reference
    # wich is inside the range of another checkbook
    sequence_string = 'Tic ' \
                    + 'CreateCheckbookReception2 Tic ' \
                    + 'CreateCheckAndCheckbookLineList2 Tic ' \
                    + 'ConfirmCheckbookReception2 Tic ' \
                    + 'DeliverCheckbookReception2Fails Tic '
    sequence_list.addSequenceString(sequence_string)

    # Make sure it is impossible to create in the same time
    # two checkbooks with the same reference, so we must
    # do deliver without tic
    sequence_string = 'Tic ' \
                    + 'CreateCheckbookReception3 Tic ' \
                    + 'CreateCheckbookReception4 Tic ' \
                    + 'CreateCheckAndCheckbookLineList3 Tic ' \
                    + 'ConfirmCheckbookReception3 Tic ' \
                    + 'CreateCheckAndCheckbookLineList4 Tic ' \
                    + 'ConfirmCheckbookReception4 Tic ' \
                    + 'DeliverCheckbookReception3 Tic ' \
                    + 'DeliverCheckbookReception4Fails '
    sequence_list.addSequenceString(sequence_string)

    # Make sure that if we have an import, then everything
    # will be confirmed automatically
    sequence_string = 'Tic ' \
                    + 'CreateCheckbookReception5 Tic ' \
                    + 'CreateCheckAndCheckbookLineList5 Tic ' \
                    + 'ConfirmCheckbookReception5 Tic ' \
                    + 'DeliverCheckbookReception5 Tic ' \
                    + 'CheckConfirmedCheckbookForImport Tic ' 
    sequence_list.addSequenceString(sequence_string)

    # Check that it is possible to have 2 receptions on the same range for 2 different checkbook models
    sequence_string = 'Tic ' \
                    + 'CreateCheckbookReception6 Tic ' \
                    + 'CreateCheckAndCheckbookLineList6 Tic ' \
                    + 'ConfirmCheckbookReception6 Tic ' \
                    + 'DeliverCheckbookReception6 Tic'
    sequence_list.addSequenceString(sequence_string)

    # play the sequence
    sequence_list.play(self)
Esempio n. 31
0
 def test_08_PersonWithoutEmail(self):
   sequence_list = SequenceList()
   sequence_string = '\
       AddUserWithoutEmail \
       Tic \
       CheckPersonWithoutEmail \
       '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 32
0
 def test_05_noMessage(self):
   sequence_list = SequenceList()
   sequence_string = '\
       AddUserA \
       Tic \
       CheckNotificationWithoutMessage \
       '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 33
0
 def test_02_noSender(self):
   sequence_list = SequenceList()
   sequence_string = '\
       AddUserA \
       Tic \
       CheckNotificationWithoutSender \
       '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 34
0
 def test_07_AttachmentMessage(self):
   sequence_list = SequenceList()
   sequence_string = '\
       AddUserA \
       Tic \
       CheckNotificationWithAttachment \
       '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 35
0
 def test_03_noSubject(self):
   sequence_list = SequenceList()
   sequence_string = '\
       AddUserA \
       Tic \
       CheckNotificationFailsWithoutSubject \
       '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 36
0
 def test_06_simpleMessage(self):
   sequence_list = SequenceList()
   sequence_string = '\
       AddUserA \
       Tic \
       CheckSimpleNotification \
       '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 37
0
 def test_01_ImportFileLine(self):
     # Simulate import of OOo file Base_importFile for Person Module.
     sequence_list = SequenceList()
     step_list = [
         'stepImportRawDataFile', 'stepCheckActivitiesCount', 'Tic',
         'stepCheckImportedPersonList'
     ]
     sequence_string = ' '.join(step_list)
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self)
    def test_11_TextMessage(self):
        sequence_list = SequenceList()
        sequence_string = '\
        AddUserA \
        Tic \
        CheckNotificationPlainTextFormat \
        '

        sequence_list.addSequenceString(sequence_string)
        sequence_list.play(self)
Esempio n. 39
0
 def test_08_MultiRecipient(self):
   sequence_list = SequenceList()
   sequence_string = '\
       AddUserA \
       AddUserB \
       Tic \
       CheckMultiRecipientNotification \
       '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
    def test_10_PersonNotification(self):
        sequence_list = SequenceList()
        sequence_string = '\
        AddUserA \
        Tic \
        CheckPersonNotification\
        '

        sequence_list.addSequenceString(sequence_string)
        sequence_list.play(self)
Esempio n. 41
0
 def test_02_ImportFileBlankLine(self):
   #Simulate import of an OOo file with blank lines.
   sequence_list = SequenceList()
   step_list = [  'stepImportFileWithBlankLine'
                 ,'Tic'
                 ,'stepCheckImportedPersonListBlank'
                ]
   sequence_string = ' '.join(step_list)
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
    def test_12_HtmlMessage(self):
        sequence_list = SequenceList()
        sequence_string = '\
        AddUserA \
        Tic \
        CheckNotificationHtmlFormat \
        '

        sequence_list.addSequenceString(sequence_string)
        sequence_list.play(self)
Esempio n. 43
0
 def test_permission_on_recipient_not_needed(self):
   """Notification Tool can be used to send Messages even when user does not
   have permission on sender or recipent documents.
   """
   sequence_list = SequenceList()
   sequence_string = '\
       AddUserA \
       Tic \
       CheckNotificationWithoutPermissionOnRecipient \
       '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 44
0
 def test_maxma_demo_workflow(self):
     """ Test the consulting workflow configuration"""
     self.all_username_list = ["demo"]
     self.accountant_username_list = self.all_username_list
     self.sales_and_purchase_username_list = self.all_username_list
     self.warehouse_username_list = self.all_username_list
     self.simple_username_list = self.all_username_list
     self.restricted_security = 0
     sequence_list = SequenceList()
     sequence_string = self.DEFAULT_SEQUENCE_LIST % dict(country='France')
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self)
Esempio n. 45
0
 def playSequence(self, sequence_string, quiet=0):
     ZopeTestCase._print(
         '\n\n\n---------------------------------------------------------------------'
     )
     ZopeTestCase._print('\nStarting New Sequence %s :' %
                         self._TestCase__testMethodName)
     ZopeTestCase._print('\n * %s... \n' % self._TestCase__testMethodDoc)
     LOG('Sequence.play', 0,
         'Starting New Sequence %s :' % self._TestCase__testMethodName)
     LOG('Sequence.play', 0, ' * %s... \n' % self._TestCase__testMethodDoc)
     sequence_list = SequenceList()
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self, quiet=quiet)
Esempio n. 46
0
 def test_05_setCheckBugClone(self, quiet=QUIET, run=RUN_ALL_TEST):
     """
   Test that a closed bug has its stop date property updated.
 """
     if not run: return
     sequence_list = SequenceList()
     step_list = [
         'stepCreateBug', 'stepCheckBugInit', 'stepOpenBug',
         'stepCloneAndCheckBug'
     ]
     sequence_string = ' '.join(step_list)
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self, quiet=quiet)
Esempio n. 47
0
 def test_01_getVariationBaseCategoryList(self, quiet=quiet, run=run_all_test):
   """
     Test the method getVariationBaseCategoryList on a resource.
   """
   if not run: return
   sequence_list = SequenceList()
   # Test when resource has no variation
   sequence_string = '\
                     CreateResource \
                     CheckGetVariationBaseCategoryList \
                     '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self, quiet=quiet)
Esempio n. 48
0
 def test_variationPropertyList(self):
     """
   Simply test if method are well generated by the property sheet.
 """
     sequence_list = SequenceList()
     sequence_string = """
                   CreateComputer
                   CheckGetVariationPropertyList
                   CheckSetVariationPropertyList
                   CheckGetVariationPropertyList
                   """
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self)
Esempio n. 49
0
 def test_01_missingFieldLibrary(self):
   """
   Create an business template with an empty skin folder.
   Check that the 'Manage Field Library' action propose to create the field
   library.
   """
   sequence_list = SequenceList()
   sequence_string = '\
                      CreateSkinFolder \
                      CreateNewBusinessTemplate \
                      CheckMissingFieldLibrary \
                      '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 50
0
 def test_01_testTaskBasicUseCase(self, quiet=0, run=run_all_test):
   """
     Test creation of task and (automatic) task_report
   """
   if not run: return
   sequence_list = SequenceList()
   sequence_string = self.default_task_sequence + '\
                      stepVerifyGeneratedByBuilderTaskReport \
                      stepStartTaskReport \
                      stepFinishTaskReport \
                      stepCloseTaskReport \
                      stepTic'
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)
Esempio n. 51
0
 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)
Esempio n. 52
0
    def test_02_checkPasswordToolDateExpired(self):
        sequence_list = SequenceList()
        sequence_string = 'CheckPasswordToolExists '  \
                          'AddUser Tic ' \
                          'Logout ' \
                          'CheckUserLogin CheckUserNotLoginWithBadPassword ' \
                          'LostPassword Tic ' \
                          'CheckMailSent ' \
                          'ModifyExpirationDate ' \
                          'GoToRandomAddress Tic '  \
                          'CheckUserLogin CheckUserNotLoginWithBadPassword ' \

        sequence_list.addSequenceString(sequence_string)
        sequence_list.play(self)
Esempio n. 53
0
 def test_01_checkTrashBinCreation(self, quiet=quiet, run=run_all_test):
   if not run: return
   if not quiet:
     message = 'Test Check TrashBin Creation'
     ZopeTestCase._print('\n%s ' % message)
     LOG('Testing... ', 0, message)
   sequence_list = SequenceList()
   sequence_string = '\
                      CheckTrashToolExists  \
                      CreateTrashBin \
                      CheckTrashBinIndexable \
                      '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self, quiet=quiet)
    def test_07_ReturnedSalePackingListWithCellDeleting(
            self, quiet=quit, run=run_all_test):
        """
      Test that deleting variations in returned sale packing list
    """
        sequence_list = SequenceList()
        sequence_string = self.default_sequence + '\
                      stepTic \
                      stepCreateReturnedPackingListWithCell \
                      stepCheckReturnedPackingListWithCellDeleting \
                      '

        sequence_list.addSequenceString(sequence_string)
        sequence_list.play(self, quiet=quiet)
Esempio n. 55
0
 def test_ignore_allowed_content_type(self):
     """
   Check that allowed content types should be ignored from a give \
   portal type in Base_getConstraintTypeListPerPortalType, \
   because checkConsistency is recursive in folders.
   Then, if not ignored this method will be called twice
 """
     sequence_list = SequenceList()
     sequence_string = """
   stepSameConstraintToPersonAndPersonModule
   stepCheckPersonNotInConstraintTypeListPerPortalType
   stepRemoveSameConstraintInPersonAndPersonModule
 """
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self)
Esempio n. 56
0
 def test_04_StopDateUpdatedOnCancelWithUsualUser(self,
                                                  quiet=QUIET,
                                                  run=RUN_ALL_TEST):
     """
   Test that cancelBug with usual user.
 """
     if not run: return
     sequence_list = SequenceList()
     step_list = [
         'stepLoginUsualUser', 'stepCreateBug', 'stepOpenBug', 'stepTic',
         'stepSetOldClosedDate', 'stepCancelBug', 'stepTic'
     ]
     sequence_string = ' '.join(step_list)
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self, quiet=quiet)
Esempio n. 57
0
 def test_08_variationPropertyList(self, quiet=quiet, run=run_all_test):
   """
     Simply test if method are well generated by the property sheet.
   """
   if not run: return
   sequence_list = SequenceList()
   # Test when resource has no variation
   sequence_string = '\
                     CreateResource \
                     CheckGetVariationPropertyList \
                     CheckSetVariationPropertyList \
                     CheckGetVariationPropertyList \
                     '
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self, quiet=quiet)
Esempio n. 58
0
    def test_01(self, quiet=quiet, run=run_all_test):
        if not run: return
        sequence_list = SequenceList()
        sequence_string = '\
                       CreateObjects \
                       Tic \
                       CreateObjectLines \
                       Tic \
                       RenderStructure \
                       CheckPlanning \
                       CheckBasic \
                       '

        sequence_list.addSequenceString(sequence_string)
        sequence_list.play(self, quiet=quiet)
Esempio n. 59
0
 def test_post_upgrade_with_bt5_that_not_exists_in_repository(self):
     """
   One Business Template installed that not exists in repository, 
   should not block checkConsistency in portal_templates
 """
     sequence_list = SequenceList()
     sequence_string = """
   stepCreateAndInstallBusinessTemplate
   stepTic
   stepCheckBusinessTemplateInstalled
   stepCheckConsistencyInTemplateTool
   stepUninstallBusinessTemplateInstalled
 """
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self)
Esempio n. 60
0
 def test_02_testMultipleLineTaskBasicUseCase(self, quiet=0, run=run_all_test):
   """
     Test creation of task with multiple task lines \
     and (automatic) creation of task_report.
   """
   if not run: return
   sequence_list = SequenceList()
   sequence_string = self.default_task_sequence_two_lines + '\
                      stepVerifyGeneratedTaskReportLines \
                      stepStartTaskReport \
                      stepFinishTaskReport \
                      stepCloseTaskReport \
                      stepTic'
   sequence_list.addSequenceString(sequence_string)
   sequence_list.play(self)