File: test_view.py

package info (click to toggle)
python-wikkid 0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 728 kB
  • sloc: python: 3,051; makefile: 12
file content (29 lines) | stat: -rw-r--r-- 1,009 bytes parent folder | download | duplicates (2)
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
28
29
#
# Copyright (C) 2010 Wikkid Developers.
#
# This software is licensed under the GNU Affero General Public License
# version 3 (see the file LICENSE).

"""Tests the display views."""

from wikkid.tests.factory import ViewTestCase


class TestView(ViewTestCase):
    """Test the display view."""

    def test_wiki_last_modified_by(self):
        """Test that the last committer is displayed properly"""
        factory = self.make_factory([
                ('SomePage/SubPage/Nested.txt', 'some text')])
        view = self.get_view(factory, '/SomePage/SubPage/Nested', 'view')
        user = view.last_modified_by
        self.assertEqual('First User', user.display_name)

    def test_other_last_modified_by(self):
        """Test that the last committer is displayed properly"""
        factory = self.make_factory([
                ('test.py', 'some text')])
        view = self.get_view(factory, '/test.py')
        user = view.last_modified_by
        self.assertEqual('First User', user.display_name)