Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

Commit

Permalink
Testing stub: more detailed update_task (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
amureki authored and mostafa-anm committed May 7, 2018
1 parent abe68a7 commit c65ac0a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions closeio/contrib/testing_stub.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,18 +303,16 @@ def create_task(self, lead_id, assigned_to, text, due_date=None,
tasks[lead_id] = []

task = {
"lead_id": lead_id,
"assigned_to": str(assigned_to),
"text": text,
"due_date": due_date.isoformat() if due_date else None,
"is_complete": is_complete
'id': 'task_{}'.format(uuid.uuid4().hex),
'lead_id': lead_id,
'assigned_to': str(assigned_to),
'text': text,
'due_date': due_date.isoformat() if due_date else None,
'is_complete': is_complete,
'date_created': datetime.utcnow().isoformat(),
'date_updated': datetime.utcnow().isoformat(),
}

task['id'] = '{}_{}'.format(
lead_id,
len(tasks[lead_id]) + 1
)

tasks[lead_id].append(task)

return task
Expand Down

0 comments on commit c65ac0a

Please sign in to comment.