예제 #1
0
파일: tests.py 프로젝트: RackHacks/django
    def test_localization(self):
        w = AdminSplitDateTime()

        with self.settings(USE_L10N=True):
            with translation.override('de-at'):
                w.is_localized = True
                self.assertEqual(
                    conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
                    '<p class="datetime">Datum: <input value="01.12.2007" type="text" class="vDateField" name="test_0" size="10" /><br />Zeit: <input value="09:30:00" type="text" class="vTimeField" name="test_1" size="8" /></p>',
                )
예제 #2
0
파일: tests.py 프로젝트: xtrqt/django
    def test_localization(self):
        w = AdminSplitDateTime()

        with self.settings(USE_L10N=True):
            with translation.override('de-at'):
                w.is_localized = True
                self.assertEqual(
                    conditional_escape(
                        w.render('test', datetime(2007, 12, 1, 9, 30))),
                    '<p class="datetime">Datum: <input value="01.12.2007" type="text" class="vDateField" name="test_0" size="10" /><br />Zeit: <input value="09:30:00" type="text" class="vTimeField" name="test_1" size="8" /></p>',
                )
예제 #3
0
파일: tests.py 프로젝트: ssaltzman/POET
    def test_localization(self):
        w = AdminSplitDateTime()

        activate('de-at')
        old_USE_L10N = settings.USE_L10N
        try:
            settings.USE_L10N = True
            w.is_localized = True
            self.assertEqual(
                conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
                '<p class="datetime">Datum: <input value="01.12.2007" type="text" class="vDateField" name="test_0" size="10" /><br />Zeit: <input value="09:30:00" type="text" class="vTimeField" name="test_1" size="8" /></p>',
            )
        finally:
            deactivate()
            settings.USE_L10N = old_USE_L10N
예제 #4
0
    def test_localization(self):
        w = AdminSplitDateTime()

        activate('de-at')
        old_USE_L10N = settings.USE_L10N
        try:
            settings.USE_L10N = True
            w.is_localized = True
            self.assertEqual(
                conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
                '<p class="datetime">Datum: <input value="01.12.2007" type="text" class="vDateField" name="test_0" size="10" /><br />Zeit: <input value="09:30:00" type="text" class="vTimeField" name="test_1" size="8" /></p>',
            )
        finally:
            deactivate()
            settings.USE_L10N = old_USE_L10N
예제 #5
0
 def test_render(self):
     w = AdminSplitDateTime()
     self.assertEqual(
         conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
         '<p class="datetime">Date: <input value="2007-12-01" type="text" class="vDateField" name="test_0" size="10" /><br />Time: <input value="09:30:00" type="text" class="vTimeField" name="test_1" size="8" /></p>',
     )
예제 #6
0
파일: tests.py 프로젝트: ssaltzman/POET
 def test_render(self):
     w = AdminSplitDateTime()
     self.assertEqual(
         conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
         '<p class="datetime">Date: <input value="2007-12-01" type="text" class="vDateField" name="test_0" size="10" /><br />Time: <input value="09:30:00" type="text" class="vTimeField" name="test_1" size="8" /></p>',
     )