Skip to content

Commit

Permalink
[#3009] Add max. num. new activities test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Nov 15, 2012
1 parent 3007c85 commit 11be483
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ckan/tests/functional/api/test_dashboard.py
Expand Up @@ -192,3 +192,14 @@ def test_06_mark_new_activities_as_read(self):
self.dashboard_mark_all_new_activities_as_old(self.new_user)
assert self.dashboard_new_activities_count(self.new_user) == 0
assert len(self.dashboard_new_activities(self.new_user)) == 0

def test_07_maximum_number_of_new_activities(self):
'''Test that the new activities count does not go higher than 15, even
if there are more than 15 new activities from the user's followers.'''
for n in range(0,20):
notes = "Updated {n} times".format(n=n)
params = json.dumps({'name': 'warandpeace', 'notes': notes})
response = self.app.post('/api/action/package_update', params=params,
extra_environ={'Authorization': str(self.joeadmin['apikey'])})
assert response.json['success'] is True
assert self.dashboard_new_activities_count(self.new_user) == 15

0 comments on commit 11be483

Please sign in to comment.