示例#1
0
def update():
    db.users.remove({})
    db.goods.remove({})
    users, goods = [], []
    for _ in range(30):
        person = Person(locales.ZH)
        user = {
            "name": person.name(),
            "age": person.age(),
            "sex": choice(["boy", "girl"]),
            "mobile": person.telephone(),
            "wechat": person.email(),
            "status": choice(["normal", "in_debt"]),
            "isVip": Development().boolean(),
        }
        users.append(user)
    db.users.insert_many(users)
示例#2
0
def dev():
    return Development()
示例#3
0
 def dv2(self, seed):
     return Development(seed=seed)
示例#4
0
 def dev(self):
     return Development()
示例#5
0
 def _developments(self, seed):
     return Development(seed=seed), Development(seed=seed)
示例#6
0
def development():
    """

    :return:
    """
    return Development()
示例#7
0
from django.test import TestCase

# Create your tests here.
from organization.models import CityDict, CourseOrganization, OrgType
from mimesis.enums import Gender
from mimesis import Address, Development
import random

if __name__ == "__main__":
    zh = Address('zh')
    c = Development()
    citys = ["上海", "北京", "杭州", "深圳", "广东"]

    for i in citys:
        city = CityDict(name=i, desc="test")
        city.save()
        for i in range(100):
            org = CourseOrganization(name=c.backend(),
                                     desc=c.programming_language(),
                                     click_num=i * random.randint(1, 1000),
                                     fav_nums=i * random.randint(1, 1000),
                                     address=zh.address())
            org.city = city
            org.save()
'''
delete from city_dict;
delete from course_organization;
select * from city_dict;
select * from course_organization;
'''