This fixes some cornercases and makes the test a) properly data-driven (don't use 'today'). b) much more extensive. This also removes some duplicate code and fixes some bugs in the actual model it tests.
This adds a unit test as well, which is a bit tricky as this is date specific.