Skip to content

Commit 9069c4c

Browse files
committed
Merge pull request #200 from Syncano/LIB-732
[LIB-732] Object() create correct;
2 parents b021de2 + 4571819 commit 9069c4c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

syncano/models/classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _set_up_object_class(cls, model):
156156

157157
@classmethod
158158
def _get_instance_name(cls, kwargs):
159-
return kwargs.get('instance_name')
159+
return kwargs.get('instance_name') or registry.instance_name
160160

161161
@classmethod
162162
def _get_class_name(cls, kwargs):

tests/integration_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,11 @@ def test_create(self):
267267
name='test', description='test', quantity=10, cost=10.5,
268268
published_at=datetime.now(), author=author, available=True)
269269

270+
book_direct = Object(class_name=self.book.name, quantity=15, cost=7.5)
271+
book_direct.save()
272+
270273
book.delete()
274+
book_direct.delete()
271275
author.delete()
272276

273277
def test_update(self):

0 commit comments

Comments
 (0)