Skip to content
Snippets Groups Projects
Commit 372f5e3c56e6 authored by Houzefa Abbasbhay's avatar Houzefa Abbasbhay :slight_smile:
Browse files

More lenient tests

in case other modules also install companies.
parent 60eb2a0dd3e1
No related branches found
No related tags found
1 merge request!19Topic/15.0/tests 15
Pipeline #35345 passed
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
---------- ----------
* Don't rebuild existing fiscal years. * Don't rebuild existing fiscal years.
* More lenient tests in case other modules also install companies.
15.0.1.0.1 15.0.1.0.1
---------- ----------
......
...@@ -52,9 +52,7 @@ ...@@ -52,9 +52,7 @@
) )
year_str = str(end_date.year) year_str = str(end_date.year)
if self.env["account.fiscalyear"].search( if self.env["account.fiscalyear"].search([("code", "=", year_str)], limit=1):
[("code", "=", year_str)], limit=1
):
return # Fiscal year already exists in this company. return # Fiscal year already exists in this company.
self.env["account.fiscalyear"].create( self.env["account.fiscalyear"].create(
......
...@@ -201,5 +201,6 @@ ...@@ -201,5 +201,6 @@
def test_name_search(self): def test_name_search(self):
"""Test name_search""" """Test name_search"""
# Check this specific case without any domains.
results = self.env["account.period"].name_search() results = self.env["account.period"].name_search()
# 12 periods for 2017, and the current year are created in demo data # 12 periods for 2017, and the current year are created in demo data
...@@ -204,3 +205,4 @@ ...@@ -204,3 +205,4 @@
results = self.env["account.period"].name_search() results = self.env["account.period"].name_search()
# 12 periods for 2017, and the current year are created in demo data # 12 periods for 2017, and the current year are created in demo data
self.assertEqual(len(results), 24) # greater-equal as we may also have other companies from other modules.
self.assertGreaterEqual(len(results), 24)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment