Skip to content

Commit

Permalink
[MIG] base_optional_quick_create: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
absal-smile committed Feb 3, 2025
1 parent 037eb05 commit 0bd3905
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions base_optional_quick_create/tests/test_quick_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,17 @@ def test_quick_create(self):
)
test_id = self.env["x_.test.model.quick"].name_create("TEST Model")
self.assertEqual(bool(test_id), True)

def test_quick_create_with_existing_name(self):
partner_id = self.env["res.partner"].name_create("Existing Partner")
self.assertEqual(bool(partner_id), True)
with self.assertRaises(UserError):
self.env["res.partner"].name_create("Existing Partner")

def test_quick_create_with_empty_name(self):
with self.assertRaises(UserError):
self.env["res.partner"].name_create("")

def test_quick_create_with_special_characters(self):
partner_id = self.env["res.partner"].name_create("Partner@123")
self.assertEqual(bool(partner_id), True)

0 comments on commit 0bd3905

Please sign in to comment.