def generate_fake_data(): from project.users.models import make_user, create_user from project.users.password import encode_password from project.tasks import actions from faker import Faker employer = create_user( make_user(email='*****@*****.**', password=encode_password('qwerty'), type='employer', balance=100000)) create_user( make_user(email='*****@*****.**', password=encode_password('qwerty'), type='employee', balance=0)) fake = Faker() for i in range(100): actions.add_task( name=fake.sentence(), price=fake.pydecimal(3, 2, True), description=fake.text(), author_id=employer['id'], )
def employer_fixture(): return create_user({ 'id': 1, 'email': 'employer@localhost', 'password': '******', 'type': 'employer', 'balance': 0, })
def user_employee(): return create_user({ 'id': 1, 'email': 'employee@localhost', 'password': '******', 'type': 'employee', 'balance': 0, })
def fixture_user(): return create_user({ 'id': 1, 'email': '*****@*****.**', 'password': encode_password('qwerty'), 'type': 'employee', 'balance': 0, })