Skip to content

Commit

Permalink
Use admin account fixture in alert profile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Nov 15, 2023
1 parent 04daaaf commit fc8b7c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/integration/web/alertprofiles_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
from nav.web.alertprofiles.views import set_active_profile


def test_profile_with_nonascii_name_should_be_saved(db):
def test_profile_with_nonascii_name_should_be_saved(db, admin_account):
factory = RequestFactory()
request = factory.get(reverse('alertprofiles-profile-save'))
request.account = Account.objects.get(pk=Account.ADMIN_ACCOUNT)
request.account = admin_account
request.session = MagicMock()
profile = AlertProfile(account=request.account, name=u'ÆØÅ')
profile.save()
Expand Down Expand Up @@ -629,8 +629,8 @@ def test_alertprofiles_remove_filter_group(db, client, dummy_filter_group):


@pytest.fixture(scope='function')
def dummy_profile():
account = Account.objects.get(id=Account.ADMIN_ACCOUNT)
def dummy_profile(admin_account):
account = admin_account
profile = AlertProfile(account=account, name=u'ÆØÅ Profile %d' % randint(1, 1000))
profile.save()
return profile
Expand All @@ -646,8 +646,8 @@ def activated_dummy_profile(dummy_profile):


@pytest.fixture(scope="function")
def dummy_filter():
filtr = Filter(name="dummy", owner=Account.objects.get(id=Account.ADMIN_ACCOUNT))
def dummy_filter(admin_account):
filtr = Filter(name="dummy", owner=admin_account)
filtr.save()
return filtr

Expand Down

0 comments on commit fc8b7c6

Please sign in to comment.