ejdecena / openacademy

0 stars 0 forks source link

[ADD] openacademy: Unit tests. T#57454 #15

Closed ejdecena closed 2 years ago

ejdecena commented 2 years ago

This is unit tests for Openacademy.

ejdecena commented 2 years ago

I get the following error when running the sessions test. Please help.

2022-06-05 21:35:28,680 240 ERROR db_test odoo.addons.openacademy.tests.test_openacademy_session: ERROR: TestSession.test_10_create_session
Traceback (most recent call last):
  File "/mnt/extra-addons/openacademy/tests/test_openacademy_session.py", line 33, in test_10_create_session
    session = self.create_session(**session_data)
  File "/mnt/extra-addons/openacademy/tests/commontest.py", line 37, in create_session
    session = self.Session.create({
  File "<decorator-gen-67>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 412, in _model_create_multi
    return create(self, [arg])
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_fields.py", line 613, in create
    recs = super().create(vals_list)
  File "<decorator-gen-13>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 413, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4070, in create
    records = self._create(data_list)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4236, in _create
    records.check_access_rule('create')
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3553, in check_access_rule
    invalid = self - self._filter_access_rules_python(operation)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3608, in _filter_access_rules_python
    return self.sudo().filtered_domain(dom or [])
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 5516, in filtered_domain
    field = model._fields[fname]
KeyError: 'responsible_id'
ejdecena commented 2 years ago

@luisg123v This PR is ready for review :-)

ejdecena commented 2 years ago

The create_objects.py file no longer exists, and the dict() syntax was replaced by the equivalent in {} in all create methods.

ejdecena commented 2 years ago

Now everything is okay, @luisg123v.