blob: 3622bdc4d7cf91986c8563bc5e5c94b9c2d2f4b4 [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001# Copyright 2016 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
Copybara854996b2021-09-07 19:36:02 +00004
5"""Unit tests for sitewide_views module."""
6from __future__ import print_function
7from __future__ import division
8from __future__ import absolute_import
9
10import unittest
11
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +010012from mrproto import usergroup_pb2
Copybara854996b2021-09-07 19:36:02 +000013from sitewide import sitewide_views
14
15
16class GroupViewTest(unittest.TestCase):
17
18 def testConstructor(self):
19 group_settings = usergroup_pb2.MakeSettings('anyone')
20 view = sitewide_views.GroupView('groupname', 123, group_settings, 999)
21
22 self.assertEqual('groupname', view.name)
23 self.assertEqual(123, view.num_members)
24 self.assertEqual('ANYONE', view.who_can_view_members)
25 self.assertEqual('/g/999/', view.detail_url)