~unifield-team/unifield-wm/us-826

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
-
    In order to test the budget module, I start by creating a new budget
-
  !record {model: crossovered.budget, id: budget_1}:
    date_from: !eval "'%s-01-01' %(datetime.now().year+1)"
    date_to: !eval "'%s-12-31' %(datetime.now().year+1)"
    name: !eval "'Budget %s' %(datetime.now().year+1)"
    code: !eval "'B%s' %(datetime.now().year+1)"
    state: draft
    analytic_account_id: account.analytic_super_product_trainings
    decision_moment: "This is the decision moment"
    
-
  I create a budget line
-
  !record {model: crossovered.budget.lines, id: budget_line_1}:
    general_budget_id: account_budget.account_budget_post_purchase0
    planned_amount: 10000.0
    crossovered_budget_id: budget_1
    
-
  I check that the fields are correctly set from the parent budget
-
  !assert {model: crossovered.budget.lines, id: budget_line_1}:
    - general_budget_code == 'PUR'
    - analytic_account_id.id == ref("account.analytic_super_product_trainings")
    - date_from == str(datetime.now().year+1) + "-01-01"
    - date_to == str(datetime.now().year+1) + "-12-31"
    

-
  I check that Initially Budget is in "draft" state
-
  !assert {model: crossovered.budget, id: budget_1}:
    - state == 'draft'
    
-
  I pressed the validate button to validate the Budget
-
  Performing a workflow action validate on module crossovered.budget
-
  !workflow {model: crossovered.budget, action: validate, ref: budget_1}
-
  I check that budget is in "Validated" state
-
  !assert {model: crossovered.budget, id: budget_1}:
    - state == 'validate'

-
  I pressed the done button to set the Budget to "Done" state
-
  Performing a workflow action done on module crossovered.budget
-
  !workflow {model: crossovered.budget, action: done, ref: budget_1}
-
  I check that budget is in "done" state
-
  !assert {model: crossovered.budget, id: budget_1}:
    - state == 'done'