diff options
author | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-09-05 14:43:46 (GMT) |
---|---|---|
committer | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-09-05 14:43:46 (GMT) |
commit | dfe685234fa35636e2961b09572ee2a8a861e727 (patch) | |
tree | 5f118f09543f8a2f153f7717e933e623dbbfc844 | |
parent | 1373be85c3ad62d5edba5f6644e5ef57f08e10fa (diff) |
create_poll function
-rw-r--r-- | webapp/webapp/features/steps.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/webapp/webapp/features/steps.py b/webapp/webapp/features/steps.py index 4a7fac3..83a40bb 100644 --- a/webapp/webapp/features/steps.py +++ b/webapp/webapp/features/steps.py @@ -41,11 +41,15 @@ def create_user_and_login(rol, username, password): login(b, username, password) +def create_poll(name, status=Poll.OPEN): + poll = Poll(data={'name': name, 'status': status}) + world.poll_id = poll.save() + + @step(u'And "([^"]*)" is "([^"]*)"') def and_poll_is_status(step, poll_name, status): status = Poll.CLOSED if status == "Cerrada" else Poll.OPEN - poll = Poll(data={'name': poll_name, 'status': status}) - world.poll_id = poll.save() + create_poll(poll_name, status) @step(u'And "([^"]*)" is binded to "([^"]*)"') |