diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 136f86680..26690051f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -142,7 +142,7 @@ jobs: strategy: matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - cockroachdb-version: ["v22.2.0"] + cockroachdb-version: ["v24.1.0"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/tests/apps/migrations/auto/integration/test_migrations.py b/tests/apps/migrations/auto/integration/test_migrations.py index 849f8e79f..2851aaee9 100644 --- a/tests/apps/migrations/auto/integration/test_migrations.py +++ b/tests/apps/migrations/auto/integration/test_migrations.py @@ -288,7 +288,12 @@ def test_text_column(self): [ x.data_type == "text", x.is_nullable == "NO", - x.column_default in ("''::text", "'':::STRING"), + x.column_default + in ( + "''", + "''::text", + "'':::STRING", + ), ] ), ) @@ -461,6 +466,7 @@ def test_timestamp_column(self): in ( "now()", "CURRENT_TIMESTAMP", + "current_timestamp()::TIMESTAMP", "current_timestamp():::TIMESTAMPTZ::TIMESTAMP", ), ] @@ -541,7 +547,11 @@ def test_interval_column(self): x.data_type == "interval", x.is_nullable == "NO", x.column_default - in ("'00:00:00'::interval", "'00:00:00':::INTERVAL"), + in ( + "'00:00:00'", + "'00:00:00'::interval", + "'00:00:00':::INTERVAL", + ), ] ), ) @@ -743,7 +753,12 @@ def test_jsonb_column(self): [ x.data_type == "jsonb", x.is_nullable == "NO", - x.column_default in ("'{}'::jsonb", "'{}':::JSONB"), + x.column_default + in ( + "'{}'", + "'{}'::jsonb", + "'{}':::JSONB", + ), ] ), ) @@ -766,7 +781,11 @@ def test_db_column_name(self): x.data_type == "character varying", x.is_nullable == "NO", x.column_default - in ("''::character varying", "'':::STRING"), + in ( + "''", + "''::character varying", + "'':::STRING", + ), ] ), ) @@ -788,7 +807,11 @@ def test_db_column_name_initial(self): x.data_type == "character varying", x.is_nullable == "NO", x.column_default - in ("''::character varying", "'':::STRING"), + in ( + "''", + "''::character varying", + "'':::STRING", + ), ] ), ) diff --git a/tests/apps/migrations/auto/test_migration_manager.py b/tests/apps/migrations/auto/test_migration_manager.py index a1988a029..872b9b936 100644 --- a/tests/apps/migrations/auto/test_migration_manager.py +++ b/tests/apps/migrations/auto/test_migration_manager.py @@ -768,15 +768,15 @@ def test_alter_column_set_default_alt(self): ) asyncio.run(manager.run()) - self.assertEqual( - self._get_column_default(), - [{"column_default": "'Unknown':::STRING"}], + self.assertIn( + self._get_column_default()[0]["column_default"], + ["'Unknown'", "'Unknown':::STRING"], ) asyncio.run(manager.run(backwards=True)) - self.assertEqual( - self._get_column_default(), - [{"column_default": "'':::STRING"}], + self.assertIn( + self._get_column_default()[0]["column_default"], + ["''", "'':::STRING"], ) @engines_only("postgres") @@ -856,9 +856,9 @@ def test_alter_column_drop_default_alt(self): old_params={"default": None}, ) asyncio.run(manager_1.run()) - self.assertEqual( - self._get_column_default(), - [{"column_default": "'Mr Manager':::STRING"}], + self.assertIn( + self._get_column_default()[0]["column_default"], + ["'Mr Manager'", "'Mr Manager':::STRING"], ) # Drop the default. @@ -879,9 +879,9 @@ def test_alter_column_drop_default_alt(self): # And add it back once more to be sure. manager_3 = manager_1 asyncio.run(manager_3.run()) - self.assertEqual( - self._get_column_default(), - [{"column_default": "'Mr Manager':::STRING"}], + self.assertIn( + self._get_column_default()[0]["column_default"], + ["'Mr Manager'", "'Mr Manager':::STRING"], ) # Run them all backwards @@ -892,9 +892,9 @@ def test_alter_column_drop_default_alt(self): ) asyncio.run(manager_2.run(backwards=True)) - self.assertEqual( - self._get_column_default(), - [{"column_default": "'Mr Manager':::STRING"}], + self.assertIn( + self._get_column_default()[0]["column_default"], + ["'Mr Manager'", "'Mr Manager':::STRING"], ) asyncio.run(manager_1.run(backwards=True))