allura
Revision | 6fa633948d23e689495ee4f9c46ac6754a5b0a8f (tree) |
---|---|
Zeit | 2012-07-07 00:47:08 |
Autor | Igor Bondarenko <jetmind2@gmai...> |
Commiter | Yaroslav Luzin |
[#4481] ticket:100 Fix test
@@ -6,9 +6,9 @@ | ||
6 | 6 | Vote for this ticket: |
7 | 7 | <br /> |
8 | 8 | <span class='vote-uparrow {% if can_vote %}vote-up{% endif %}'>⇑</span> |
9 | - <span class='votes-up {% if voted == 1 %}voted{% endif %}'>{{artifact.votes_up}}</span> up | |
9 | + <span id='votes-up' class='votes-up {% if voted == 1 %}voted{% endif %}'>{{artifact.votes_up}}</span> up | |
10 | 10 | <span class='vote-downarrow {% if can_vote %}vote-down{% endif %}'>⇓</span> |
11 | - <span class='votes-down {% if voted == -1 %}voted{% endif %}'>{{artifact.votes_down}}</span> down | |
11 | + <span id='votes-down' class='votes-down {% if voted == -1 %}voted{% endif %}'>{{artifact.votes_down}}</span> down | |
12 | 12 | {% if can_vote %} |
13 | 13 | <form action="{{ action }}" method="POST"> |
14 | 14 | {# csrf protection will be automatically inserted here (_session_id field) #} |
@@ -780,9 +780,10 @@ class TestFunctionalController(TrackerTestController): | ||
780 | 780 | |
781 | 781 | def test_vote(self): |
782 | 782 | r = self.new_ticket(summary='test vote').follow() |
783 | - vote = r.html.find('div', {'id': 'vote'}) | |
784 | - assert_in('0 up', str(vote)) | |
785 | - assert_in('0 down', str(vote)) | |
783 | + votes_up = r.html.find('span', {'id': 'votes-up'}) | |
784 | + votes_down = r.html.find('span', {'id': 'votes-down'}) | |
785 | + assert_in('0', str(votes_up)) | |
786 | + assert_in('0', str(votes_down)) | |
786 | 787 | |
787 | 788 | # invalid vote |
788 | 789 | r = self.app.post('/bugs/1/vote', dict(vote='invalid')) |
@@ -806,9 +807,10 @@ class TestFunctionalController(TrackerTestController): | ||
806 | 807 | |
807 | 808 | # make sure that on the page we see the same result |
808 | 809 | r = self.app.get('/bugs/1/') |
809 | - vote = r.html.find('div', {'id': 'vote'}) | |
810 | - assert_in('1 up', str(vote)) | |
811 | - assert_in('1 down', str(vote)) | |
810 | + votes_up = r.html.find('span', {'id': 'votes-up'}) | |
811 | + votes_down = r.html.find('span', {'id': 'votes-down'}) | |
812 | + assert_in('1', str(votes_up)) | |
813 | + assert_in('1', str(votes_down)) | |
812 | 814 | |
813 | 815 | |
814 | 816 | class TestMilestoneAdmin(TrackerTestController): |