You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.2 KiB

  1. -
  2. Cleanup previous test run
  3. -
  4. !python {model: project.issue}: |
  5. res = self.search(cr, uid, [('name', '=', 'My monitor is flickering')])
  6. self.unlink(cr, uid, res)
  7. -
  8. Create a new Issue
  9. -
  10. !record {model: project.issue, id: issue1, view: False}:
  11. name: "My monitor is flickering"
  12. project_id: project.project_project_1
  13. priority: "3"
  14. user_id: base.user_root
  15. partner_id: base.res_partner_2
  16. email_from: agr@agrolait.com
  17. categ_ids:
  18. - project_issue.project_issue_category_01
  19. -
  20. Close the Issue
  21. -
  22. !python {model: project.issue}: |
  23. self.case_close(cr, uid, [ref("issue1")])
  24. -
  25. Force the Issue's Create Date and Close Date
  26. Created friday before opening hour, closed on next monday near closing hour
  27. -
  28. !python {model: project.issue}: |
  29. import time
  30. self.write(cr, uid, [ref("issue1"),], {
  31. 'create_date': time.strftime('2013-11-22 06:15:00'),
  32. 'date_closed': time.strftime('2013-11-25 16:45:00'),
  33. })
  34. -
  35. There should be Service Level info generated on the Issue
  36. -
  37. !assert {model: project.issue, id: issue1, string: Issue should have calculated service levels}:
  38. - len(sla_control_ids) == 2
  39. -
  40. Assign an additional "Response SLA" to the Contract
  41. -
  42. !python {model: account.analytic.account}: |
  43. self.write(cr, uid, [ref('project.project_project_1_account_analytic_account')],
  44. {'sla_ids': [(4, ref('sla_response'))]})
  45. -
  46. Button to Reapply the SLA Definition
  47. -
  48. !python {model: project.sla}: |
  49. self._reapply_slas(cr, uid, [ref('sla_resolution')], recalc_closed=True)
  50. -
  51. There should be two Service Level lines generated on the Issue
  52. -
  53. !assert {model: project.issue, id: issue1, string: Issue should have two calculated service levels}:
  54. - len(sla_control_ids) == 2
  55. -
  56. The Issue's Resolution SLA should be "3 business days"
  57. -
  58. !python {model: project.issue}: |
  59. issue = self.browse(cr, uid, ref('issue1'))
  60. for x in issue.sla_control_ids:
  61. print x.sla_line_id.name
  62. if x.sla_line_id.id == ref("sla_resolution_rule2"):
  63. assert x.sla_achieved == 1, "Issue resolution SLA should be achieved"
  64. break
  65. else:
  66. assert False, 'Issue Resolution SLA should be "3 business days"'