def _create_admin_user(self): admin = User.objects.create(username=self.ADMIN_USERNAME, is_staff=True, is_superuser=True, is_active=True) admin.set_password(self.ADMIN_PASSWORD) admin.save()
def __setup_employees(): from .models import Employee Employee.objects.all().delete() admin = Employee(email="*****@*****.**", ) admin.set_password("admin") admin.save() admin = Employee(email="*****@*****.**", ) admin.set_password("admin1") admin.save()
def __setup_employees(): from store.models import Employee Employee.objects.all().delete() admin = Employee(email = "*****@*****.**",) admin.set_password("admin") admin.save() admin = Employee(email = "*****@*****.**",) admin.set_password("admin1") admin.save()
def __setup_admins(): from django.contrib.auth.models import User User.objects.all().delete() admin = User(username = "******", is_staff = True, is_superuser = True) admin.set_password("admin") admin.save() admin = User(username = "******", is_staff = True, is_superuser = True) admin.set_password("admin1") admin.save()
def _get_admin(self): admin = User( username='******', email='*****@*****.**', is_active=True, is_staff=True, ) admin.set_password('admin') admin.save() return admin