Ejemplo n.º 1
0
def get_student(school):
    """create sample student """
    name = fake.name()
    return Student.objects.create(admission_id=fake.name(),
                                  first_name=name.split(' ')[0],
                                  last_name=name.split(' ')[-1],
                                  sex=fake.sex(),
                                  date_of_birth=fake.date(),
                                  place_of_birth=fake.city(),
                                  status=fake.student_status(),
                                  residential_address=fake.address(),
                                  hometown=fake.city(),
                                  nationality='Ghanaian',
                                  phone='0200000000',
                                  email=fake.email(),
                                  school=school)
Ejemplo n.º 2
0
def create_student(school, **params):
    """Create a sample recipe and return it"""
    defaults = {
        'admission_id': fake.name(),
        'first_name': fake.name().split(' ')[0],
        'last_name': fake.name().split(' ')[-1],
        'sex': fake.sex(),
        'status': fake.student_status(),
        'date_of_birth': fake.date(),
        'place_of_birth': fake.city(),
        'hometown': fake.city(),
        'residential_address': fake.address(),
        'nationality': 'Ghanaian'
    }
    defaults.update(params)  # Overwrite or add addtional key/values

    return Student.objects.create(school=school, **defaults)
Ejemplo n.º 3
0
def get_student_dafault_payload(**params):
    """Return sample student payload for only required fields"""
    name = fake.name()
    defaults = {
        'admission_id': fake.name(),
        'first_name': name.split(' ')[0],
        'last_name': name.split(' ')[1],
        'sex': fake.sex(),
        'status': fake.student_status(),
        'date_of_birth': fake.date(),
        'place_of_birth': fake.city(),
        'hometown': fake.city(),
        'residential_address': fake.address(),
        'nationality': 'Ghanaian',
    }
    defaults.update(params)
    return defaults
Ejemplo n.º 4
0
def get_school(**params):
    """Create a sample schol and return it"""
    defaults = {
        'name': fake.name().split(' ')[0],
        'level': fake.school_levels(),
        'motto': fake.name(),
        'code': fake.date(),
        'address': fake.address(),
        'city': fake.city(),
        'region': fake.region(),
        'email': fake.email(),
    }
    defaults.update(params)  # Overwrite or add addtional key/values

    return School.objects.create(**defaults)
Ejemplo n.º 5
0
def get_school():
    return School.objects.create(name=str(uuid.uuid4())[:9],
                                 address=fake.address(),
                                 city=fake.city(),
                                 region=fake.region())