• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

allura


Commit MetaInfo

修訂21d36d31fd0a6a3ce2d8e235241c617c33d305a5 (tree)
時間2012-07-08 06:27:29
作者Yuriy <yuriyarhipovua@yand...>
CommiterYuriy

Log Message

[#4481] ticket:103 tests and pep8

Change Summary

差異

--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -576,7 +576,6 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
576576 assigned_to_id=self.assigned_to_id and str(self.assigned_to_id) or None,
577577 status=self.status,
578578 private=self.private,
579- votes=self.votes,
580579 custom_fields=self.custom_fields)
581580
582581 @classmethod
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
@@ -31,6 +31,8 @@
3131 <td class="{{t.open_or_closed}}">{{t.status}}</td>
3232 {% elif col['name'] == 'assigned_to' %}
3333 <td>{% if t.assigned_to_id %}{{t.assigned_to.display_name}}{% endif %}</td>
34+ {% elif col['name'] == 'votes' %}
35+ <td>{{ t.votes }}</td>
3436 {% else %}
3537 {% set fld = c.app.globals.get_custom_field(col['name']) %}
3638 {% if fld and fld.type == 'user' %}
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -819,6 +819,14 @@ class TestFunctionalController(TrackerTestController):
819819 assert_in('1', str(votes_up))
820820 assert_in('1', str(votes_down))
821821
822+ r = self.app.get('/bugs/')
823+ assert "Votes" in r
824+ self.app.post(
825+ '/admin/bugs/set_options',
826+ params={'EnableVoting': 'false'})
827+ r = self.app.get('/bugs/')
828+ assert "Votes" not in r
829+
822830
823831 class TestMilestoneAdmin(TrackerTestController):
824832 def _post(self, params, **kw):
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -64,6 +64,8 @@ def _mongo_col_to_solr_col(name):
6464 return 'ticket_num_i'
6565 elif name == 'summary':
6666 return 'snippet_s'
67+ elif name == 'votes':
68+ return 'votes_i'
6769 elif name == '_milestone':
6870 return '_milestone_s'
6971 elif name == 'status':
@@ -393,6 +395,7 @@ class RootController(BaseController):
393395 dict(name='summary', sort_name='snippet_s', label='Summary', active=True),
394396 dict(name='_milestone', sort_name='_milestone_s', label='Milestone', active=True),
395397 dict(name='status', sort_name='status_s', label='Status', active=True),
398+ dict(name='votes', sort_name='votes_s', label='Votes', active=True),
396399 dict(name='assigned_to', sort_name='assigned_to_s', label='Owner', active=True)]
397400 for field in sortable_custom_fields:
398401 columns.append(dict(name=field['name'], sort_name=field['sortable_name'], label=field['label'], active=True))
@@ -1479,7 +1482,8 @@ class MilestoneController(BaseController):
14791482 milestone=self.milestone,
14801483 total=progress['hits'],
14811484 closed=progress['closed'],
1482- q=self.progress_key)
1485+ q=self.progress_key,
1486+ voting_enabled=True,)
14831487 result['url_sort'] = ''
14841488 if sort:
14851489 sort_split = sort.split(' ')