* filter card data by age
* add setting for hide_age
* add option to settings form
* fix name to consistently use hide_age
* rename filter, use setting for filter
* add test for old hiding old data
* fix migration to contain correct imports, remove month from timedelta
* remove months from timedelta, allow blank
* fix with block
* add settings test
* add test for filter
* mock localtime
* fix timezone issues with tests
* linting
* linting
* Adjust migration
Co-authored-by: Benjamin Häublein <benjaminh@debian.vm.hp>
Co-authored-by: Christopher C. Wells <git@chris-wells.net>
* add option for hiding empty dashboard cards
* rework add option for hiding empty dashboard cards
missed statistics.html
* don't exit early in cards
* add forms test for dashboard_hide_empty
* add tests for cards
* fix early exit in card_diaperchange_latest
* change dependency of migration
* rename migration
* introduce hiding of cards in templates
* linting
* add context to test_card_diaperchange_last
* setup MockUserRequest
* add context to all cards test cases
* add test for settings_dashboard_hide_empty_on
* change dashboard_hide_test, but it doesn't work
* add test for _user_wants_hide
* fix test_user_wants_hide user object, simpliy check for data['empty']
* add test for user_wants_hide to every card
* linting
* fix trailing whitespace
* rename user_wants_hide to hide_empty
* fix hidden statistics
* add user.refresh_from_db to test case, add test case for dashboard_refresh_rate
* Follow redirect and correct assertion
Co-authored-by: jcgoette <jcgoette@gmail.com>
Co-authored-by: Benjamin Häublein <benjaminh@debian.vm.hp>
Co-authored-by: Christopher C. Wells <git@chris-wells.net>
The previous setting of "Etc/UTC" appears to no longer be valid in certain
circumstances. This was causes tests to fail on user settings because the
provided default was invalid. "UTC" should be more uniformly recognized so
hopefully this does not have any downstream effects.
Closes#203
Note: this new test has been tagged "isolate" and excluded from regular tests
because the locale behavior being tested involves Django internals that must
be handled at initialization and cannot be changed during runtime (i.e. this
new test with PASS when run alone, but FAIL when run with other tests).
A future commit or set of commits should come up with a way to execute all
tests tagged "isolate" in isolated test environments as part of the full test
suite. For now, this test simply does not run until it is run manually.
The frontend library uses an datetime strong format for it's base language (US English)
that is not supported by Python's datetime. This commit adds custom formats to
support the frontend strings.
The command works correctly when run, but for some reason is having issues through the test (which uses call_command). The issue does not appear to be related to Django 2.0's changes to the call_command method.