Beispiel #1
0
    def test_render_edit_secondary_for_admin(self):
        form = GroupNickForm(self.group, instance=self.secondary_nick, for_admin=True)
        html = form.as_p()

        # show 'preferred name' checkbox
        self.assertIn("Use this as their preferred name, instead of 'Placebo'", html)

        # group nicks can have abbreviations
        self.assertIn("Abbreviation", html)
        # differentiator field is available to admins
        self.assertIn("Differentiator", html)
Beispiel #2
0
    def test_render_edit_primary_for_admin(self):
        form = GroupNickForm(self.group, instance=self.primary_nick, for_admin=True)
        html = form.as_p()

        # No 'preferred name' checkbox, as this is already the primary nick
        self.assertNotIn("Use this as their preferred name, instead of 'Gasman'", html)

        # group nicks can have abbreviations
        self.assertIn("Abbreviation", html)
        # differentiator field is available to admins
        self.assertIn("Differentiator", html)
Beispiel #3
0
    def test_render_add_for_admin(self):
        form = GroupNickForm(self.group, for_admin=True)
        html = form.as_p()

        # the 'add nick' form gives the option to set preferred name
        self.assertIn("Use this as their preferred name, instead of 'Placebo'", html)

        # group nicks can have abbreviations
        self.assertIn("Abbreviation", html)
        # differentiator field is available to admins
        self.assertIn("Differentiator", html)
Beispiel #4
0
    def test_render_edit_secondary_for_admin(self):
        form = GroupNickForm(self.group, instance=self.secondary_nick, for_admin=True)
        html = form.as_p()

        # show 'preferred name' checkbox
        self.assertIn("Use this as their preferred name, instead of 'Placebo'", html)

        # group nicks can have abbreviations
        self.assertIn("Abbreviation", html)
        # differentiator field is available to admins
        self.assertIn("Differentiator", html)
Beispiel #5
0
    def test_render_edit_primary_for_admin(self):
        form = GroupNickForm(self.group, instance=self.primary_nick, for_admin=True)
        html = form.as_p()

        # No 'preferred name' checkbox, as this is already the primary nick
        self.assertNotIn("Use this as their preferred name, instead of 'Gasman'", html)

        # group nicks can have abbreviations
        self.assertIn("Abbreviation", html)
        # differentiator field is available to admins
        self.assertIn("Differentiator", html)
Beispiel #6
0
    def test_render_add_for_admin(self):
        form = GroupNickForm(self.group, for_admin=True)
        html = form.as_p()

        # the 'add nick' form gives the option to set preferred name
        self.assertIn("Use this as their preferred name, instead of 'Placebo'", html)

        # group nicks can have abbreviations
        self.assertIn("Abbreviation", html)
        # differentiator field is available to admins
        self.assertIn("Differentiator", html)