|
1 | | -from psycopg2 import IntegrityError |
2 | | - |
3 | | -from odoo.exceptions import ValidationError |
4 | 1 | from odoo.tests import tagged |
5 | 2 | from odoo.tests.common import TransactionCase |
6 | 3 |
|
@@ -32,25 +29,12 @@ def test_01_suffix_model_creation(self): |
32 | 29 | self.assertTrue(suffix.active) |
33 | 30 | self.assertEqual(suffix.sequence, 10) # Default |
34 | 31 |
|
35 | | - def test_02_suffix_name_uniqueness(self): |
36 | | - """Test that suffix name must be unique.""" |
37 | | - with self.assertRaises((IntegrityError, ValidationError)), self.cr.savepoint(): |
38 | | - self.env["spp.name.suffix"].create( |
39 | | - { |
40 | | - "name": "Jr.", |
41 | | - "code": "JR2", |
42 | | - } |
43 | | - ) |
44 | | - |
45 | | - def test_02b_suffix_code_uniqueness(self): |
46 | | - """Test that suffix code must be unique.""" |
47 | | - with self.assertRaises((IntegrityError, ValidationError)), self.cr.savepoint(): |
48 | | - self.env["spp.name.suffix"].create( |
49 | | - { |
50 | | - "name": "Junior", |
51 | | - "code": "JR", |
52 | | - } |
53 | | - ) |
| 32 | + def test_02_suffix_data_loaded(self): |
| 33 | + """Test that default suffix data is loaded correctly.""" |
| 34 | + self.assertEqual(self.suffix_jr.name, "Jr.") |
| 35 | + self.assertEqual(self.suffix_jr.code, "JR") |
| 36 | + self.assertEqual(self.suffix_phd.name, "PhD") |
| 37 | + self.assertEqual(self.suffix_phd.code, "PHD") |
54 | 38 |
|
55 | 39 | def test_03_name_with_suffix(self): |
56 | 40 | """Test that suffix is appended to the computed name.""" |
|
0 commit comments