تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3557 أدوات العرض

I want to test a controller that is supposed to create a record.

I have this unit test file:

class TestController(HttpCase):

def test_create_record(self, target_url):
response = self.url_open('/my/create_obj', data={'name': 'obay'}, timeout=100)
# after this, the object is created in the database
# but it doesn't show in the next search results
self.env['object.name'].search([]) # empty record set

Does the url_open roll back immediately after it finishes the request?


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مارس 25
1319
4
أبريل 24
174171
0
ديسمبر 23
2101
0
أكتوبر 23
1174
0
أكتوبر 23
1941