Commit Graph

39 Commits

Author SHA1 Message Date
Christopher C. Wells cd946280cb Format code with black 2022-02-09 16:00:30 -08:00
Christopher C. Wells 97fa8d7000 Support POST only for logout 2021-12-18 17:42:53 -05:00
Amith211 df51cc05d8
fix en_GB tests 2021-11-15 17:15:57 +00:00
Amith211 0312a4210d
add en-gb format tests 2021-11-14 01:20:20 +00:00
Christopher Charbonneau Wells d74f35d765
Handle format customization in middelware (#332)
This is done to allow for format difference between `en-US` (`en`) and `en-GB` that are not well supported by Django's format handling.
2021-11-12 10:13:08 -08:00
Christopher C. Wells 9e2048b26c Change default locale to en-US 2021-10-26 19:55:16 -07:00
Christopher C. Wells 45cb43958d Set default password policies in base settings 2021-09-16 19:14:48 -07:00
Christopher C. Wells 16c34ca7f0 Add test for custom date format 2021-08-01 04:42:38 -07:00
Christopher C. Wells 1689bc8e20 Refactor API key reset as part of settings form
This adds core CSRF protection to the reset functionality.
2021-06-21 21:27:45 -07:00
Benjamin Häublein e8696a8b00
Dashboard: Hide old data (#215)
* 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>
2021-06-19 14:09:05 -07:00
Benjamin Häublein 1dca1cc050
Add option for hiding empty dashboard cards (#213)
* 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>
2021-05-13 20:28:39 -07:00
Christopher C. Wells 250e07e739 Set default timezone as UTC
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
2021-05-05 05:58:32 -07:00
Christopher C. Wells b014dd29fb Fix tests for Python 3.6 support (#170) 2020-10-25 09:32:39 -07:00
Christopher C. Wells 7abe7b2a5f Add test for USE_24_HOUR_TIME_FORMAT (#148)
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.
2020-07-22 21:56:29 -07:00
Christopher C. Wells 23ac4ade91 Add specific failing string detail to datetime format test (#148) 2020-07-22 21:14:34 -07:00
Christopher C. Wells 3135d1d9d0 Use settings override for rolling session refresh test 2020-06-28 05:31:34 -07:00
Peter Hardy 2806d0a22f The rest of the middleware commit 2020-05-17 20:11:08 +10:00
Christopher C. Wells 7727e254c3 Add specific test for timezone setting via form 2020-02-14 10:56:13 -08:00
Christopher C. Wells b54b0facb3 Account for timezone field in existing forms tests 2020-02-14 10:56:13 -08:00
Christopher C. Wells 17ed16bc8b Hide Child from Timer detail in one child use cases 2020-01-31 12:01:17 -08:00
Christopher C. Wells cc0eef33a8 Add support for additional datetime input formats
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.
2020-01-20 15:50:35 -08:00
Christopher C. Wells d68410cdae Use cookie for language setting
Django 4.0 will deprecate the use of session for language setting.
2020-01-04 08:09:28 -08:00
Christopher C. Wells a11524a47d Update Python dependencies (Django 3.x) 2020-01-04 06:37:42 -08:00
Christopher C. Wells 13a0424fc2 Add basic translation feature tests. 2019-04-18 19:52:17 -07:00
Christopher Charbonneau Wells 4b7bb69218 Add support for Django 2.1 and Django Filters 2.0.0. 2018-08-04 13:00:51 -07:00
Christopher Charbonneau Wells ab2717ed56 Do not deal with child count during root redirect. 2018-05-20 14:39:28 -07:00
Christopher Charbonneau Wells 5dc372281b Remove all unicode_literals imports. 2018-02-17 17:09:40 -05:00
Christopher Charbonneau Wells f2a8cdec2d Update URL definitions to Django 2.0 style. 2017-12-13 18:12:32 -05:00
Christopher Charbonneau Wells 183a30b0a3 Only allow staff members to manage users. 2017-12-13 13:49:10 -05:00
Christopher Charbonneau Wells 53a35f3f89 Changes users URLs to plural form to match the rest of the app. 2017-12-11 17:25:25 -05:00
Christopher Charbonneau Wells 9796452da7 Add tests for user management tasks. 2017-12-11 17:18:22 -05:00
Christopher Charbonneau Wells ce9d89f6a5 Update password change test. 2017-12-06 14:39:41 -05:00
Christopher Charbonneau Wells 1fa3c49f69 Fix and re-enable the reset management command test.
Not 100% sure of why this fixes the issue - it appears that changes to django.test.TestCase in Django 2.0 led to the test failing.
2017-12-06 12:01:45 -05:00
Christopher Charbonneau Wells 2f21e3d7f4 Add API key reset test. 2017-12-05 10:53:28 -05:00
Christopher Charbonneau Wells 8b98a60ad1 Disable reset command tests temporarily.
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.
2017-12-03 16:54:19 -05:00
Christopher Charbonneau Wells 0c57e21c02 Add a user password change form. 2017-12-02 16:20:15 -05:00
Christopher Charbonneau Wells bd2655166e Add tests for babybuddy app code. 2017-11-12 19:43:40 -05:00
Christopher Charbonneau Wells f9f6ea5e88 Add management command tests. 2017-11-11 17:25:28 -05:00
Christopher Charbonneau Wells 00d3cf65f5 Add a basic Welcome page. 2017-11-09 14:37:06 -05:00