예제 #1
0
 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()
예제 #2
0
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()
예제 #3
0
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()
예제 #4
0
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