From bdb6062bf293be20f4c8ccf8c8dc60e351f500b4 Mon Sep 17 00:00:00 2001 From: Parth Sharma Date: Mon, 7 Apr 2025 12:17:20 +0530 Subject: [PATCH 1/2] get_or_create test fix --- tests/_utils/local_test.sh | 2 +- tests/get_or_create/models.py | 4 ++-- tests/singlestore_settings.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/_utils/local_test.sh b/tests/_utils/local_test.sh index d87247bd22b..b99f72dfcf4 100755 --- a/tests/_utils/local_test.sh +++ b/tests/_utils/local_test.sh @@ -18,5 +18,5 @@ export TABLE_STORAGE_TYPE_PREFETCH_RELATED="ROWSTORE REFERENCE" export TABLE_STORAGE_TYPE_MANY_TO_MANY="ROWSTORE REFERENCE" # specify the path to the test to run -MODULE_TO_TEST=serializers +MODULE_TO_TEST=get_or_create ./tests/runtests.py --settings=singlestore_settings --noinput -v 3 $MODULE_TO_TEST --keepdb diff --git a/tests/get_or_create/models.py b/tests/get_or_create/models.py index 4107e185a35..e5cfb139161 100644 --- a/tests/get_or_create/models.py +++ b/tests/get_or_create/models.py @@ -2,7 +2,7 @@ class Person(models.Model): - first_name = models.CharField(max_length=100, unique=True) + first_name = models.CharField(max_length=100, primary_key=True) last_name = models.CharField(max_length=100) birthday = models.DateField() defaults = models.TextField() @@ -22,7 +22,7 @@ class Profile(models.Model): class Tag(models.Model): - text = models.CharField(max_length=255, unique=True) + text = models.CharField(max_length=255, primary_key=True) class Thing(models.Model): diff --git a/tests/singlestore_settings.py b/tests/singlestore_settings.py index 4a117c08bd6..0713553cc12 100644 --- a/tests/singlestore_settings.py +++ b/tests/singlestore_settings.py @@ -8,7 +8,7 @@ "HOST": "127.0.0.1", "PORT": 3306, "USER": "root", - "PASSWORD": "p", + "PASSWORD": "", "NAME": "django_db", }, "other": { @@ -16,7 +16,7 @@ "HOST": "127.0.0.1", "PORT": 3306, "USER": "root", - "PASSWORD": "p", + "PASSWORD": "", "NAME": "django_db_other", }, } From 7d9f4300969ef2ee13b5edd2161cbbc6297ae960 Mon Sep 17 00:00:00 2001 From: Parth Sharma Date: Mon, 7 Apr 2025 18:42:31 +0530 Subject: [PATCH 2/2] reverting local setup changes --- tests/_utils/local_test.sh | 2 +- tests/singlestore_settings.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/_utils/local_test.sh b/tests/_utils/local_test.sh index b99f72dfcf4..d87247bd22b 100755 --- a/tests/_utils/local_test.sh +++ b/tests/_utils/local_test.sh @@ -18,5 +18,5 @@ export TABLE_STORAGE_TYPE_PREFETCH_RELATED="ROWSTORE REFERENCE" export TABLE_STORAGE_TYPE_MANY_TO_MANY="ROWSTORE REFERENCE" # specify the path to the test to run -MODULE_TO_TEST=get_or_create +MODULE_TO_TEST=serializers ./tests/runtests.py --settings=singlestore_settings --noinput -v 3 $MODULE_TO_TEST --keepdb diff --git a/tests/singlestore_settings.py b/tests/singlestore_settings.py index 0713553cc12..4a117c08bd6 100644 --- a/tests/singlestore_settings.py +++ b/tests/singlestore_settings.py @@ -8,7 +8,7 @@ "HOST": "127.0.0.1", "PORT": 3306, "USER": "root", - "PASSWORD": "", + "PASSWORD": "p", "NAME": "django_db", }, "other": { @@ -16,7 +16,7 @@ "HOST": "127.0.0.1", "PORT": 3306, "USER": "root", - "PASSWORD": "", + "PASSWORD": "p", "NAME": "django_db_other", }, }