<s> from __future__ import absolute_import <EOL> from django . core . urlresolvers import reverse <EOL> from sentry . app import tsdb <EOL> from sentry . testutils import APITestCase <EOL> class TeamStatsTest ( APITestCase ) : <EOL> def test_simple ( self ) : <EOL> self . login_as ( user = self . user ) <EOL> team = self . create_team ( name = '<STR_LIT:foo>' ) <EOL> project_1 = self . create_project ( team = team , name = '<STR_LIT:a>' ) <EOL> project_2 = self . create_project ( team = team , name = '<STR_LIT:b>' ) <EOL> team_2 = self . create_team ( name = '<STR_LIT:bar>' ) <EOL> project_3 = self . create_project ( team = team_2 , name = '<STR_LIT:c>' ) <EOL> tsdb . incr ( tsdb . models . project , project_1 . id , count = <NUM_LIT:3> ) <EOL> tsdb . incr ( tsdb . models . project , project_2 . id , count = <NUM_LIT:5> ) <EOL> tsdb . incr ( tsdb . models . project , project_3 . id , count = <NUM_LIT:10> ) <EOL> url = reverse ( '<STR_LIT>' , kwargs = { <EOL> '<STR_LIT>' : team . organization . slug , <EOL> '<STR_LIT>' : team . slug , <EOL> } ) <EOL> response = self . client . get ( url , format = '<STR_LIT>' ) <EOL> assert response . status_code == <NUM_LIT:200> , response . content <EOL> assert response . data [ - <NUM_LIT:1> ] [ <NUM_LIT:1> ] == <NUM_LIT:8> , response . data <EOL> for point in response . data [ : - <NUM_LIT:1> ] : <EOL> assert point [ <NUM_LIT:1> ] == <NUM_LIT:0> <EOL> assert len ( response . data ) == <NUM_LIT> </s>
