raphaelm / python-sepaxml

SEPA Direct Debit XML generation in python
MIT License
112 stars 43 forks source link

Always use `datetime` to generate timestamps, fixes #39 #40

Closed bibz closed 2 years ago

bibz commented 3 years ago

Only rely on datetime to generate timestamps, and not time and datetime.

This makes it easier for downstream projects to freeze time and get reproducible timestamps. freezegun is a nice and easy way to do so, but I stuck to regular mocks for this PR to avoid a new dependency.

With freezegun:


- @pytest.mark.usefixtures("freeze_random", "freeze_datetime")
+ @pytest.mark.usefixtures("freeze_random")
+ @freezegun.freeze_time(datetime.datetime(2021, 10, 2, 20, 17, 35))
  def test_two_debits(sdd, today):
      payment1 = {
bibz commented 3 years ago

This PR fixes issue #39 .

raphaelm commented 2 years ago

Merged manually