From fcb5dbfec0542faaa1b0adad754a1caf1bcd65e2 Mon Sep 17 00:00:00 2001 From: Paolo Melchiorre Date: Wed, 29 Mar 2017 23:52:42 +0200 Subject: Fixed #27996 -- Added RandomUUID function and CryptoExtension to contrib.postgres. --- tests/postgres_tests/migrations/0001_setup_extensions.py | 6 ++++-- tests/postgres_tests/migrations/0002_create_test_models.py | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'tests/postgres_tests/migrations') diff --git a/tests/postgres_tests/migrations/0001_setup_extensions.py b/tests/postgres_tests/migrations/0001_setup_extensions.py index d090ff7fd6..b00c6c0838 100644 --- a/tests/postgres_tests/migrations/0001_setup_extensions.py +++ b/tests/postgres_tests/migrations/0001_setup_extensions.py @@ -4,13 +4,14 @@ from django.db import migrations try: from django.contrib.postgres.operations import ( - BtreeGinExtension, CITextExtension, CreateExtension, HStoreExtension, - TrigramExtension, UnaccentExtension, + BtreeGinExtension, CITextExtension, CreateExtension, CryptoExtension, + HStoreExtension, TrigramExtension, UnaccentExtension, ) except ImportError: BtreeGinExtension = mock.Mock() CITextExtension = mock.Mock() CreateExtension = mock.Mock() + CryptoExtension = mock.Mock() HStoreExtension = mock.Mock() TrigramExtension = mock.Mock() UnaccentExtension = mock.Mock() @@ -24,6 +25,7 @@ class Migration(migrations.Migration): # Ensure CreateExtension quotes extension names by creating one with a # dash in its name. CreateExtension('uuid-ossp'), + CryptoExtension(), HStoreExtension(), TrigramExtension(), UnaccentExtension(), diff --git a/tests/postgres_tests/migrations/0002_create_test_models.py b/tests/postgres_tests/migrations/0002_create_test_models.py index 842848dd47..4cd37e5e43 100644 --- a/tests/postgres_tests/migrations/0002_create_test_models.py +++ b/tests/postgres_tests/migrations/0002_create_test_models.py @@ -191,6 +191,13 @@ class Migration(migrations.Migration): ('when', models.DateTimeField(null=True, default=None)), ] ), + migrations.CreateModel( + name='UUIDTestModel', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('uuid', models.UUIDField(default=None, null=True)), + ] + ), migrations.CreateModel( name='RangesModel', fields=[ -- cgit v1.3