Add summary and activity screens, remove private datasets from counts
[ckanext-dga-stats.git] / ckanext / test_stats_plugin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
 
from ckan.tests import url_for
 
from ckanext.stats.tests import StatsFixture
 
class TestStatsPlugin(StatsFixture):
 
    def test_01_config(self):
        from pylons import config
        paths = config['extra_public_paths']
        publicdir = os.path.join(os.path.dirname(os.path.dirname(__file__)),
            'public')
        assert paths.startswith(publicdir), (publicdir, paths)
 
    def test_02_index(self):
        url = url_for('stats')
        out = self.app.get(url)
        assert 'Total number of Datasets' in out, out
        assert 'Most Edited Datasets' in out, out
 
    def test_03_leaderboard(self):
        url = url_for('stats_action', action='leaderboard')
        out = self.app.get(url)
        assert 'Leaderboard' in out, out