From 02ccdf9b9395306d3df2836bfeb861fb87d29a0b Mon Sep 17 00:00:00 2001 From: Parth Sharma Date: Thu, 15 May 2025 14:51:15 +0530 Subject: [PATCH 1/2] Fix of basic tests --- tests/basic/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/basic/models.py b/tests/basic/models.py index 59a6a8d67ffe..94b315301b8b 100644 --- a/tests/basic/models.py +++ b/tests/basic/models.py @@ -6,6 +6,7 @@ import uuid from django.db import models +from django_singlestore.schema import ModelStorageManager class Article(models.Model): @@ -21,7 +22,7 @@ def __str__(self): class FeaturedArticle(models.Model): article = models.OneToOneField(Article, models.CASCADE, related_name="featured") - + objects = ModelStorageManager("REFERENCE") class ArticleSelectOnSave(Article): class Meta: From 116f62dd2ef020d52180151389e9e2c4985c7087 Mon Sep 17 00:00:00 2001 From: Parth Sharma Date: Thu, 15 May 2025 17:28:14 +0530 Subject: [PATCH 2/2] change in test --- tests/basic/tests.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/basic/tests.py b/tests/basic/tests.py index ea9228376ca7..f1a904c23376 100644 --- a/tests/basic/tests.py +++ b/tests/basic/tests.py @@ -801,12 +801,10 @@ def _update(self, *args, **kwargs): ): asos.save(force_update=True) msg = ( - "An error occurred in the current transaction. You can't " - "execute queries until the end of the 'atomic' block." + "Save with update_fields did not affect any rows." ) with self.assertRaisesMessage(DatabaseError, msg) as cm: asos.save(update_fields=["pub_date"]) - self.assertIsInstance(cm.exception.__cause__, DatabaseError) finally: Article._base_manager._queryset_class = orig_class