33import copy
44import json
55
6- from django .conf import settings
76from django .test import TestCase , override_settings
87from django .core .urlresolvers import reverse
98
@@ -342,19 +341,24 @@ def test_gettimelinedata(self):
342341 "base" : "2+4" ,
343342 "ben" : "float" ,
344343 "env" : "1" ,
345- "revs" : 2
344+ "revs" : "2"
346345 }
347346 response = self .client .get (path , data )
348347 self .assertEquals (response .status_code , 200 )
349348 responsedata = json .loads (response .content .decode ())
349+
350350 self .assertEquals (
351351 responsedata ['error' ], "None" , "there should be no errors" )
352352 self .assertEquals (
353353 len (responsedata ['timelines' ]), 1 , "there should be 1 benchmark" )
354354 self .assertEquals (
355- len (responsedata ['timelines' ][0 ]['branches' ][ 'master' ] ),
355+ len (responsedata ['timelines' ][0 ]['branches' ]),
356356 2 ,
357- "there should be 2 timelines" )
357+ "there should be 2 branches" )
358+ self .assertEquals (
359+ len (responsedata ['timelines' ][0 ]['branches' ]['default' ]),
360+ 1 ,
361+ "there should be 1 timeline for master" )
358362 self .assertEquals (
359363 len (responsedata ['timelines' ][0 ]['branches' ]['master' ]['1' ]),
360364 2 ,
@@ -371,7 +375,7 @@ def setUp(self):
371375 Environment .objects .create (name = 'Dual Core' , cpu = 'Core 2 Duo 8200' )
372376 self .data = {
373377 'commitid' : 'abcd1' ,
374- 'branch' : settings . DEF_BRANCH ,
378+ 'branch' : 'master' ,
375379 'project' : 'MyProject' ,
376380 'executable' : 'myexe O3 64bits' ,
377381 'benchmark' : 'float' ,
@@ -399,3 +403,13 @@ def test_reports_post_returns_405(self):
399403 response = self .client .post (reverse ('codespeed.views.reports' ), {})
400404
401405 self .assertEqual (response .status_code , 405 )
406+
407+
408+ class TestFeeds (TestCase ):
409+
410+ def test_latest_result_feed (self ):
411+ response = self .client .get (reverse ('latest-results' ))
412+
413+ self .assertEqual (response .status_code , 200 )
414+ content = response .content .decode ()
415+ self .assertIn ('<atom:link ' , content )
0 commit comments