Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)