certbot/acme/tests
Daniel Drexler ae7b4a1755
Support Register Unsafely in Update (#8212)
* Allow user to remove email using update command

Fixes #3162. Slight change to control flow to replace current email
addresses with an empty list. Also add appropriate result message when
an email is removed.

* Update ACME to allow update to remove fields

- New field type "UnFalseyField" that treats all non-None fields as
  non-empty
- Contact changed to new field type to allow sending of empty contact
  field
- Certbot update adjusted to use tuple instead of None when empty
- Test updated to check more logic
- Unrelated type hint added to keep pycharm gods happy

* Moved some mocks into decorators

* Restore default to `contact` but do not serialize

- Add `to_partial_json` and `fields_to_partial_json` to Registration
- Store private variable noting if the value of the `contact` field was
  provided by the user.
- Change message when updating without email to reflect removal of
  all contact info.
- Add note in changelog that `update_account` with the
  `--register-unsafely-without-email` flag will remove contact
  from an account.

* Reverse logic for field handling on serialization

Now forcably add contact when serilizing, but go back to base `jose`
field type.

* Responding to Review

- change out of date name
- update several comments
- update `from_data` function of `Registration`
- Update test to remove superfluous mock

* Responding to review

- Change comments to make from_data more clear
- Remove code worried about None (omitempty has got my back)
- Update test to be more reliable
- Add typing import with comment to avoid pylint bug
2020-08-26 15:22:51 -07:00
..
testdata Fix TLS-ALPN tests with newer versions of OpenSSL (#8026) 2020-06-01 15:18:38 -07:00
challenges_test.py Do not require mock in Python 3 in acme module (#7910) 2020-04-15 11:27:55 -07:00
client_test.py Correct a typo in acme/tests/client_test.py (#8186) 2020-08-05 11:44:23 -07:00
crypto_util_test.py Cleanup more pylint issues (#7848) 2020-03-16 09:43:48 -07:00
errors_test.py Do not require mock in Python 3 in acme module (#7910) 2020-04-15 11:27:55 -07:00
fields_test.py Refactor tests out of packaged module for acme plugin (#7600) 2019-11-26 15:25:41 -08:00
jose_test.py Lint certbot code on Python 3, and update Pylint to the latest version (#7551) 2019-12-10 14:12:50 -08:00
jws_test.py Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00
magic_typing_test.py Do not require mock in Python 3 in acme module (#7910) 2020-04-15 11:27:55 -07:00
messages_test.py Support Register Unsafely in Update (#8212) 2020-08-26 15:22:51 -07:00
standalone_test.py Fix TLS-ALPN tests with newer versions of OpenSSL (#8026) 2020-06-01 15:18:38 -07:00
test_util.py Lint certbot code on Python 3, and update Pylint to the latest version (#7551) 2019-12-10 14:12:50 -08:00
util_test.py Refactor tests out of packaged module for acme plugin (#7600) 2019-11-26 15:25:41 -08:00