File: test_entry_dates.py

package info (click to toggle)
python-mt-940 4.30.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,272 kB
  • sloc: python: 1,746; makefile: 201
file content (35 lines) | stat: -rw-r--r-- 711 bytes parent folder | download
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
import mt940


def test_entry_dates_wrapping_years():
    transactions = mt940.models.Transactions()
    statement = mt940.tags.Statement()
    data = dict(
        amount='123',
        status='D',
        year=2000,
    )

    # Regular statement
    statement(transactions, dict(
        data.items(),
        month=1,
        day=1,
    ))

    # Statement which wraps to the future
    statement(transactions, dict(
        data.items(),
        month=12,
        day=31,
        entry_day=1,
        entry_month=1,
    ))
    # Statement which wraps the past year
    statement(transactions, dict(
        data.items(),
        month=1,
        day=1,
        entry_day=31,
        entry_month=12,
    ))