跳至內容
選單
此問題已被標幟
3586 瀏覽次數

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
3月 25
1339
4
4月 24
174201
0
12月 23
2121
0
10月 23
1183
0
10月 23
1975