Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3584 Lượt xem

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?


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 25
1339
4
thg 4 24
174201
0
thg 12 23
2121
0
thg 10 23
1182
0
thg 10 23
1972