lostplaces-backend/lostplaces/lostplaces_app/tests/__init__.py

13 lines
341 B
Python
Raw Normal View History

2020-09-03 20:11:02 +02:00
from django.db import models as django_models
from django.contrib.auth.models import User
2020-09-03 20:06:06 +02:00
2020-09-03 20:11:02 +02:00
2020-09-03 20:06:06 +02:00
def mock_user():
explorer_list = User.objects.all()
2020-09-03 20:06:06 +02:00
if len(explorer_list) <= 0:
return User.objects.create_user(
2020-09-03 20:06:06 +02:00
username='testpeter',
password='Develop123'
)
else:
2020-09-03 22:22:04 +02:00
return explorer_list[0]