Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/basic/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import uuid

from django.db import models
from django_singlestore.schema import ModelStorageManager


class Article(models.Model):
Expand All @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions tests/basic/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading