Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRogelio Mita <rogeliomita@activitycentral.com>2013-09-03 15:17:48 (GMT)
committer Rogelio Mita <rogeliomita@activitycentral.com>2013-09-03 15:17:48 (GMT)
commit9dd4872885411ba21efb4c6b9988a84fcfa42eaf (patch)
tree67b1399a35ced8c7416dd27baf277793f607facd
parent61744cab2b525805941b0d8ffd2c91f6ef3e5706 (diff)
Timestamp assertion
-rw-r--r--webapp/webapp/features/upload_poll_result.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/webapp/webapp/features/upload_poll_result.py b/webapp/webapp/features/upload_poll_result.py
index 8db0105..bc0ab2d 100644
--- a/webapp/webapp/features/upload_poll_result.py
+++ b/webapp/webapp/features/upload_poll_result.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
from lettuce import step, world
from lettuce.django import django_url
-from nose.tools import assert_true
+from nose.tools import assert_true, assert_equals
+from polls.models import Poll
from poll_result_details import (create_poll_result_file,
get_pollster_by_username)
@@ -42,5 +43,9 @@ def i_should_see_a_message_that_says_text1_and_text2(step, text1, text2):
@step(u'And "([^"]*)" has the time string "([^"]*)"')
-def and_group1_has_the_time_string_group2(step, group1, group2):
- assert False, 'This step must be implemented'
+def file_name_has_the_time_string_time_string(step, file_name, time_string):
+ poll = Poll.get(world.poll_id)
+ result_files = poll.get_result_files()
+ result_file = filter(
+ lambda f: file_name == f.get_file_name(), result_files)[0]
+ assert_equals(time_string, result_file.get_upload_timestamp())