소스 검색

[IMP] Improved the Test case for the search method

Saifuddin 7 년 전
부모
커밋
13697fa3a4
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      mass_editing/tests/test_mass_editing.py

+ 10 - 0
mass_editing/tests/test_mass_editing.py

@@ -21,11 +21,21 @@ class TestMassEditing(common.TransactionCase):
         self.partner_model = model_obj.\
             search([('model', '=', 'res.partner')])
         self.user_model = model_obj.search([('model', '=', 'res.users')])
+        """Calling the Search method without context for \
+            the Search from the List view of the Fields"""
         self.fields_model = self.env['ir.model.fields'].\
             search([('model_id', '=', self.partner_model.id),
                     ('name', 'in', ['email', 'phone', 'category_id', 'comment',
                                     'country_id', 'customer', 'child_ids',
                                     'title'])])
+        """Calling the Search method with context for the Search \
+            model_id field related fields in the fields_ids"""
+        self.fields_model = self.env['ir.model.fields'].\
+            with_context({'mass_edit': True}).\
+            search([('model_id', '=', self.partner_model.id),
+                    ('name', 'in', ['email', 'phone', 'category_id', 'comment',
+                                    'country_id', 'customer', 'child_ids',
+                                    'title'])])
         self.mass = self._create_mass_editing(self.partner_model,
                                               self.fields_model)
         self.copy_mass = self.mass.copy()