If you test this addon after installing `partner_event`, you get this error in all tests:
ERROR: test_validate_pass_reset_error (odoo.addons.password_security.tests.test_res_users.TestResUsers)
` It should throw PassError on reset inside min threshold
Traceback (most recent call last):
` File "/opt/odoo/auto/addons/password_security/tests/test_res_users.py", line 143, in test_validate_pass_reset_error
` rec_id = self._new_record()
` File "/opt/odoo/auto/addons/password_security/tests/test_res_users.py", line 46, in _new_record
` partner_id = self.env['res.partner'].create(self.partner_vals)
` File "/opt/odoo/auto/addons/mail_tracking_mailgun/models/res_partner.py", line 154, in create
` return super(ResPartner, self).create(vals)
` File "/opt/odoo/auto/addons/partner_firstname/models/res_partner.py", line 54, in create
` return super(ResPartner, self.with_context(context)).create(vals)
` File "/opt/odoo/custom/src/odoo/odoo/addons/base/res/res_partner.py", line 532, in create
` partner = super(Partner, self).create(vals)
` File "/opt/odoo/auto/addons/mail/models/mail_thread.py", line 228, in create
` thread = super(MailThread, self).create(values)
` File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3847, in create
` record = self.browse(self._create(old_vals))
` File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4006, in _create
` self.recompute()
` File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5336, in recompute
` vals = rec._convert_to_write({n: rec[n] for n in ns})
` File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5336, in <dictcomp>
` vals = rec._convert_to_write({n: rec[n] for n in ns})
` File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5232, in __getitem__
` return self._fields[key].__get__(self, type(self))
` File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 918, in __get__
` value = record._cache[self]
` File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5584, in __getitem__
` return value.get() if isinstance(value, SpecialValue) else value
` File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 48, in get
` raise self.exception
` AccessError: (u'Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:\n- Events/User\n\n(Document model: event.registration)', None)
Since creating users or partners in tests has a very high probability to collide with other addons, this test is being moved to post mode.
Also, to avoid the above permissions issue, the partner is actually created through the admin user, which actually has permissions to read everything. Then, it is `.sudo()`ed later, to perform the module tests correctly. The tests do not get affected because what is being tested was not [intended to be] the partner creation itself, but the password policy enforcement.
* Modify overloaded web_login action to not trigger a password expiration check
if the login process is not complete yet (e.g. due to auth_totp)
* Add unit test for new logic
* Fix warning caused by unrelated unit test
* Add logic to overloaded web_login action to log out users with expired
passwords, preventing the password reset from being ignored
* Add unit test for new logic
* [FIX] password_security: Fix password stored
* [REF] password_security: use a unified check_password private method to validate rules and history password
* Bump versions
* Installable to True
* Add Usage section to ReadMe w/ Runbot link
* `_crypt_context` now directly exposes the `CryptContext`
* Change all instances of openerp to odoo
* [ADD] res_users_password_security: New module
* Create new module to lock down user passwords
* [REF] res_users_password_security: PR Review fixes
* Also add beta pass history rule
* [ADD] res_users_password_security: Pass history and min time
* Add pass history memory and threshold
* Add minimum time for pass resets through web reset
* Begin controller tests
* Fix copyright, wrong year for new file
* Add tests for password_security_home
* Left to do web_auth_reset_password
* Fix minimum reset threshold and finish tests
* Bug fixes per review
* [REF] password_security: PR review improvements
* Change tech name to password_security
* Use new except format
* Limit 1 & new api
* Cascade deletion for pass history
* [REF] password_security: Fix travis + style
* Fix travis errors
* self to cls
* Better variable names in tests
* [FIX] password_security: Fix travis errors