Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3604 Visualizações

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?


Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
0
mar. 25
1375
4
abr. 24
174280
0
dez. 23
2172
0
out. 23
1204
0
out. 23
2014