django.forms.NullBooleanSelect - python examples

Here are the examples of the python api django.forms.NullBooleanSelect taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

3 View Complete Implementation : test_nullbooleanselect.py
Copyright GNU Affero General Public License v3.0
Author : nesdis
Blank and Null in Django| Django Ti...
Blank and Null in Django| Django Tips #8
    @override_settings(USE_L10N=True)
    def test_l10n(self):
        """
        The NullBooleanSelect widget's options are lazily localized (#17190).
        """
        widget = NullBooleanSelect()

        with translation.override('de-at'):
            self.check_html(widget, 'id_bool', True, html=(
                """
                <select name="id_bool">
                    <option value="1">Unbekannt</option>
                    <option value="2" selected>Ja</option>
                    <option value="3">Nein</option>
                </select>
                """
            ))

3 View Complete Implementation : test_nullbooleanselect.py
Copyright GNU Affero General Public License v3.0
Author : nesdis
    @override_settings(USE_L10N=True)
    def test_l10n(self):
        """
        The NullBooleanSelect widget's options are lazily localized (#17190).
        """
        widget = NullBooleanSelect()

        with translation.override('de-at'):
            self.check_html(widget, 'id_bool', True, html=(
                """
                <select name="id_bool">
                    <option value="unknown">Unbekannt</option>
                    <option value="true" selected>Ja</option>
                    <option value="false">Nein</option>
                </select>
                """
            ))