Skip to content

Commit

Permalink
Add auth tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsmkn committed May 16, 2024
1 parent d253f6d commit 5d442c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/pentest_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.db.transaction import on_commit
from faker import Faker
from knox.models import AuthToken
from PIL import Image as PILImage
from PIL import ImageDraw, ImageFont

Expand Down Expand Up @@ -636,9 +637,12 @@ def _create_user(first_name, last_name, *, superuser=False):
user.user_profile.receive_newsletter = True
user.user_profile.save()

_, token = AuthToken.objects.create(user=user, expiry=None)

user_info = {
"username": user.username,
"password": users_password,
"api-token": token,
}

if superuser:
Expand Down

0 comments on commit 5d442c2

Please sign in to comment.