Ticket #18318: django-ticket18318.diff

File django-ticket18318.diff, 1.8 KB (added by Michael Manfre, 12 years ago)

Support for the next 3rd party backend

  • tests/regressiontests/admin_scripts/tests.py

    diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py
    index 98492ff..ad5da6c 100644
    a b import sys  
    1313
    1414from django import conf, bin, get_version
    1515from django.conf import settings
     16from django.db import connection
    1617from django.test.simple import DjangoTestSuiteRunner
    1718from django.utils import unittest
    1819from django.test import LiveServerTestCase
    1920
    2021test_dir = os.path.dirname(os.path.dirname(__file__))
    21 expected_query_re = re.compile(r'CREATE TABLE [`"]admin_scripts_article[`"]', re.IGNORECASE)
    22 
    2322
    2423class AdminScriptTestCase(unittest.TestCase):
    2524    def write_settings(self, filename, apps=None, is_dir=False, sdict=None):
    class ManageAlternateSettings(AdminScriptTestCase):  
    859858        "alternate: manage.py builtin commands work with settings provided as argument"
    860859        args = ['sqlall', '--settings=alternate_settings', 'admin_scripts']
    861860        out, err = self.run_manage(args)
    862         self.assertRegexpMatches(out, expected_query_re)
     861        expected = r'create table %s' % connection.ops.quote_name('admin_scripts_article')
     862        self.assertTrue(expected in out.lower())
    863863        self.assertNoOutput(err)
    864864
    865865    def test_builtin_with_environment(self):
    866866        "alternate: manage.py builtin commands work if settings are provided in the environment"
    867867        args = ['sqlall', 'admin_scripts']
    868868        out, err = self.run_manage(args, 'alternate_settings')
    869         self.assertRegexpMatches(out, expected_query_re)
     869        expected = r'create table %s' % connection.ops.quote_name('admin_scripts_article')
     870        self.assertTrue(expected in out.lower())
    870871        self.assertNoOutput(err)
    871872
    872873    def test_builtin_with_bad_settings(self):
Back to Top