-
Notifications
You must be signed in to change notification settings - Fork 208
/
fake.py
44 lines (40 loc) · 1.11 KB
/
fake.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# _*_ coding: utf-8 _*_
"""
Created by Allen7D on 2018/5/12.
"""
from app import create_app
from app.core.db import db
from app.models.user import User
__author__ = 'Allen7D'
app = create_app()
with app.app_context():
with db.auto_commit():
# 创建一个超级管理员
user = User()
user.openid = '999'
user.email = '999@qq.com'
user.nickname = '超级管理员'
user.username = 'super'
user.auth = 2
user.password = '123456'
db.session.add(user)
with db.auto_commit():
# 创建一个普通管理员
user = User()
user.openid = '777'
user.email = '777@qq.com'
user.nickname = '普通管理员'
user.username = 'admin'
user.auth = 1
user.password = '123456'
db.session.add(user)
with db.auto_commit():
# 创建一个用户
user = User()
user.openid = '111'
user.email = '111@qq.com'
user.nickname = '我是用户'
user.username = 'user'
user.auth = 1
user.password = '123456'
db.session.add(user)