Skip to content

Commit b6906c1

Browse files
committed
Commit to db
1 parent 20172f0 commit b6906c1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/functional/test_f_profile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import pytest
44

5+
from django.db import transaction
56
from django.urls import reverse
67

78
from selenium.webdriver.common.by import By
@@ -39,7 +40,7 @@ def test_user_profile(browser: "SmartDriver", afg_user: "User"):
3940
select.select_by_visible_text("Spanish")
4041

4142
browser.find_element(By.TAG_NAME, "button").click()
42-
43-
afg_user.refresh_from_db()
43+
transaction.get_autocommit()
44+
transaction.on_commit(lambda: afg_user.refresh_from_db())
4445
assert afg_user.language == "es"
4546
assert afg_user.timezone.key == "Europe/Rome"

0 commit comments

Comments
 (0)