Skip to content

Commit

Permalink
[FIX] spp_change_request_base: Fix issues with the tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalesedwin1123 committed Feb 14, 2025
1 parent c3014de commit e12f135
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spp_change_request_base/tests/test_change_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def setUpClass(cls):
super().setUpClass()
cls._test_change_request = cls._create_change_request()

def test_01_create(self):
def test_01_assign_to_user(self):
self.assertEqual(
self._test_change_request.assign_to_id,
self.env.user,
Expand All @@ -33,7 +33,7 @@ def test_03_unlink(self):
"Draft change request should unlinkable by its creator!",
)

def test_05_assign_to_user(self):
def test_04_assign_to_admin_user(self):
admin = self.env.ref("base.user_admin")
self._test_change_request.assign_to_user(admin)
self.assertEqual(
Expand All @@ -45,20 +45,20 @@ def test_05_assign_to_user(self):
with self.assertRaisesRegex(UserError, "^.*not have any validation sequence defined.$"):
self._test_change_request.assign_to_user(self.env.user)

def test_07_open_request_detail(self):
def test_05_open_request_detail(self):
res = self._test_change_request.open_request_detail()
self.assertListEqual(
[res.get("type"), res.get("tag"), res.get("params", {}).get("type")],
["ir.actions.client", "display_notification", "danger"],
"Request Type ID does not exist, client should display error notification!",
)

def test_08_cancel_error(self):
def test_06_cancel_error(self):
with self.assertRaisesRegex(UserError, "^.*request to be cancelled must be in draft.*$"):
self._test_change_request.state = "validated"
self._test_change_request._cancel(self._test_change_request)

def test_09_cancel(self):
def test_07_cancel(self):
self.assertListEqual(
[
self._test_change_request.state,
Expand All @@ -83,12 +83,12 @@ def test_09_cancel(self):
"Cancelled CR should have date cancelled info.!",
)

def test_10_check_user_error(self):
def test_8_check_user_error(self):
self._test_change_request.assign_to_id = None
with self.assertRaisesRegex(UserError, "^.*no user assigned.*$"):
self._test_change_request._check_user(process="Apply")

def test_11_check_user(self):
def test_9_check_user(self):
with self.assertRaisesRegex(UserError, "^You are not allowed.*$"):
self._test_change_request.with_user(2)._check_user(process="Apply")
self.assertTrue(
Expand Down

0 comments on commit e12f135

Please sign in to comment.