Skip to content

Commit 0c2fdd1

Browse files
committed
adding a test to check the error of a class not being in the backend
1 parent 8893d7c commit 0c2fdd1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/functional/test_make_persistent.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import pytest
22

3+
from dataclay import DataClayObject
4+
from dataclay.exceptions import DataClayException
35
from dataclay.contrib.modeltest.family import Dog, Family, Person
46
from dataclay.contrib.modeltest.remote import MakePersistentTestClass
57

@@ -241,6 +243,15 @@ async def test_persistent_references_async(client):
241243
assert person == family.members[0]
242244

243245

246+
def test_persistent_error_unknown_module(client):
247+
class InvalidClass(DataClayObject):
248+
pass
249+
250+
a = InvalidClass()
251+
with pytest.raises(DataClayException):
252+
a.make_persistent()
253+
254+
244255
# Remote methods
245256

246257

0 commit comments

Comments
 (0)