Commit 69fab17e authored by Miquel Torres's avatar Miquel Torres
Browse files

Remove usage of DEF_BRANCH in the feeds module

parent 47b6477a
......@@ -35,15 +35,14 @@ class ResultFeed(Feed):
class LatestEntries(ResultFeed):
description = "Last benchmark runs"
description = "Last Results"
def result_filter(self):
return Q(revision__branch__name=settings.DEF_BRANCH)
return Q()
class LatestSignificantEntries(ResultFeed):
description = "Last benchmark runs with significant changes"
description = "Last results with significant changes"
def result_filter(self):
return Q(revision__branch__name=settings.DEF_BRANCH,
colorcode__in=('red', 'green'))
return Q(colorcode__in=('red', 'green'))
......@@ -134,6 +134,9 @@ def save_result(data):
def create_report_if_enough_data(rev, exe, e):
"""Triggers Report creation when there are enough results"""
if exe.project.track is not True:
return False
last_revs = Revision.objects.filter(
......@@ -403,3 +403,13 @@ class TestReports(TestCase):
response ='codespeed.views.reports'), {})
self.assertEqual(response.status_code, 405)
class TestFeeds(TestCase):
def test_latest_result_feed(self):
response = self.client.get(reverse('latest-results'))
self.assertEqual(response.status_code, 200)
content = response.content.decode()
self.assertIn('<atom:link ', content)
......@@ -9,9 +9,9 @@ urlpatterns = patterns('',
url(r'^$', TemplateView.as_view(template_name='home.html'), name='home'),
url(r'^about/$', TemplateView.as_view(template_name='about.html'), name='about'),
# RSS for reports
url(r'^feeds/latest/$', LatestEntries(), name='latest_feeds'),
url(r'^feeds/latest/$', LatestEntries(), name='latest-results'),
url(r'^feeds/latest_significant/$', LatestSignificantEntries(),
urlpatterns += patterns('codespeed.views',
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment