Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style |
| 3 | # license that can be found in the LICENSE file or at |
| 4 | # https://developers.google.com/open-source/licenses/bsd |
| 5 | |
| 6 | """Unit tests for sitewide_views module.""" |
| 7 | from __future__ import print_function |
| 8 | from __future__ import division |
| 9 | from __future__ import absolute_import |
| 10 | |
| 11 | import unittest |
| 12 | |
| 13 | from proto import usergroup_pb2 |
| 14 | from sitewide import sitewide_views |
| 15 | |
| 16 | |
| 17 | class GroupViewTest(unittest.TestCase): |
| 18 | |
| 19 | def testConstructor(self): |
| 20 | group_settings = usergroup_pb2.MakeSettings('anyone') |
| 21 | view = sitewide_views.GroupView('groupname', 123, group_settings, 999) |
| 22 | |
| 23 | self.assertEqual('groupname', view.name) |
| 24 | self.assertEqual(123, view.num_members) |
| 25 | self.assertEqual('ANYONE', view.who_can_view_members) |
| 26 | self.assertEqual('/g/999/', view.detail_url) |