def sample_category(*args, **kwargs):
    """Returns a sample Category object for testing"""
    user = _get_user(**kwargs)

    return Category.objects.create(title=sample_id(),
                                   description='',
                                   created_by=user)
def sample_portfolio(**kwargs) -> Portfolio:
    """Create and return a sample portfolio for testing"""
    user = _get_user(**kwargs)
    return Portfolio.objects.create(
        reference=sample_id(),
        created_by=user,
    )
def sample_task(*args, **kwargs):
    """Returns a sample Task object for testing"""
    user = _get_user(**kwargs)

    return Task.objects.create(title=sample_id(),
                               description='',
                               created_by=user,
                               duration=1,
                               completion_days=random.randint(1, 14))
def _sample_user():
    return User.objects.create_user(email=sample_email(), password=sample_id())