Skip to content

Commit

Permalink
[FIX] translation-required: Skip tests folder
Browse files Browse the repository at this point in the history
Fix #321
  • Loading branch information
moylop260 committed Sep 8, 2021
1 parent 7d727a9 commit b8e470c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pylint_odoo/checkers/no_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,9 @@ def visit_call(self, node):
self.add_message('invalid-commit', node=node)

# Call the message_post()
if (isinstance(node, astroid.Call) and
base_dirname = os.path.basename(os.path.normpath(
os.path.dirname(self.linter.current_file)))
if (base_dirname != 'tests' and isinstance(node, astroid.Call) and
isinstance(node.func, astroid.Attribute) and
node.func.attrname == 'message_post'):
for arg in itertools.chain(node.args, node.keywords or []):
Expand Down
4 changes: 4 additions & 0 deletions pylint_odoo/test_repo/broken_module/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ def setUp(self):

def method1(self, example_var):
return example_var

def test_1(self):
self.partner.message_post(body="Test", subtype="mail.mt_comment")
self.partner.message_post("Test", subtype="mail.mt_comment")

0 comments on commit b8e470c

Please sign in to comment.