6 Commits

Author SHA1 Message Date
graham-dds
bb886dbe0f Add tests for portfolio.initial_clin_dict property
In doing this, fixed a bug on the clin.is_active property
2020-02-21 14:31:29 -05:00
graham-dds
108f65f928 Use pendulum for datetime operations when possible
Currently, we use both Python's built-in datetime library and Pendulum
to do datetime operations. For the sake of consistency, we should try to
stick to one library for datetimes. We could have used either, but
Pendulum has a more ergonomic API, so I decided to go with it when
possible.

The places where were we didn't / couldn't replace datetime are:
- checking instances of datetimes. Pendulum's objects are subclasses of
  python native datetime objects, so it's still useful to import
  datetime in those cases of using is_instance()
- WTForms date validators expect datetime style string formats --
  Pendulum has its own format for formatting/ parsing strings. As such,
  our custom validator DateRange needs to use datetime.stptime() to
  account for this format.
2020-02-17 10:38:52 -05:00
graham-dds
e553a673b1 Tests for total_obligated_funds portfolio prop 2020-02-11 14:27:29 -05:00
graham-dds
52489b6bca Add upcoming_obligated_funds property to portfolio 2020-02-11 14:27:29 -05:00
graham-dds
7a0dc4d264 Add properties to portfolio model
1. Funding duration

Returns a tuple of the earliest period of performance start date and
latest period of performance end date for all active task order in a  portfolio.

2. Days to funding expiration
Returns the numbei of days between today and the lastest
period performance end date of all active task orders

3. Active task orders
Returns a list of a portfolio's active task orders a
2019-11-25 13:12:35 -05:00
dandds
1c0c5dd9c5 soft deletes available for applications and environments
- parent relation will not include applications or environments marked
  as deleted
- domain classes will exclude deleted objects from selections
- changed some test factories to use domain_word for resource names,
  because they were using person names and it bugged me
2019-04-15 15:58:38 -04:00