• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Revision6fa633948d23e689495ee4f9c46ac6754a5b0a8f (tree)
Zeit2012-07-07 00:47:08
AutorIgor Bondarenko <jetmind2@gmai...>
CommiterYaroslav Luzin

Log Message

[#4481] ticket:100 Fix test

Ändern Zusammenfassung

Diff

--- a/Allura/allura/templates/widgets/vote.html
+++ b/Allura/allura/templates/widgets/vote.html
@@ -6,9 +6,9 @@
66 Vote for this ticket:
77 <br />
88 <span class='vote-uparrow {% if can_vote %}vote-up{% endif %}'>&uArr;</span>
9- <span class='votes-up {% if voted == 1 %}voted{% endif %}'>{{artifact.votes_up}}</span> up&nbsp;
9+ <span id='votes-up' class='votes-up {% if voted == 1 %}voted{% endif %}'>{{artifact.votes_up}}</span> up&nbsp;
1010 <span class='vote-downarrow {% if can_vote %}vote-down{% endif %}'>&dArr;</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
1212 {% if can_vote %}
1313 <form action="{{ action }}" method="POST">
1414 {# csrf protection will be automatically inserted here (_session_id field) #}
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -780,9 +780,10 @@ class TestFunctionalController(TrackerTestController):
780780
781781 def test_vote(self):
782782 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))
786787
787788 # invalid vote
788789 r = self.app.post('/bugs/1/vote', dict(vote='invalid'))
@@ -806,9 +807,10 @@ class TestFunctionalController(TrackerTestController):
806807
807808 # make sure that on the page we see the same result
808809 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))
812814
813815
814816 class TestMilestoneAdmin(TrackerTestController):