Skip to content

Commit

Permalink
fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Oct 21, 2024
1 parent ab57cc0 commit 02549c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/extras/testutils/factories/django_celery_beat.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Meta:
class PeriodicTaskFactory(AutoRegisterModelFactory):
name = factory.Sequence(lambda n: "PeriodicTask%03d" % n)
interval = factory.SubFactory(IntervalScheduleFactory)
task = "hope_dedup_engine.tasks.process"
task = ""

class Meta:
model = PeriodicTask
8 changes: 6 additions & 2 deletions tests/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ def app(
yield django_app


def test_login_enable_superuser(app: "DjangoTestApp") -> None:
def test_login_enable_superuser(app: "DjangoTestApp", settings: "SettingsWrapper") -> None:
from country_workspace.models import User

settings.FLAGS = {"LOCAL_LOGIN": [("boolean", True)]}

url = reverse("workspace:login")
res = app.get(url)
res.forms["login-form"]["username"] = "superuser"
Expand All @@ -45,9 +47,11 @@ def test_login_enable_superuser(app: "DjangoTestApp") -> None:
).exists()


def test_login_usse(app: "DjangoTestApp") -> None:
def test_login_usse(app: "DjangoTestApp", settings: "SettingsWrapper") -> None:
from country_workspace.models import User

settings.FLAGS = {"LOCAL_LOGIN": [("boolean", True)]}

url = reverse("workspace:login")
res = app.get(url)
res.forms["login-form"]["username"] = "user"
Expand Down
4 changes: 3 additions & 1 deletion tests/test_user_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ def app(
yield django_app


def test_login(app, user, data: "list[Household]"):
def test_login(app, user, data: "list[Household]", settings: "SettingsWrapper"):
from testutils.perms import user_grant_permissions, user_grant_role

settings.FLAGS = {"LOCAL_LOGIN": [("boolean", True)]}

program = data[0].program
home = reverse("workspace:index")
res = app.get(home)
Expand Down

0 comments on commit 02549c3

Please sign in to comment.