Skip to content
This repository was archived by the owner on Jan 12, 2022. It is now read-only.

Commit 953b110

Browse files
committed
Merge pull request #80 from GoogleCloudPlatform/add_ndb_test
Add ndb test
2 parents facb839 + af78d4b commit 953b110

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

tests/e2e/tests/ndb_test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import os
2+
3+
from google.appengine.ext.ndb import model, tasklets
4+
5+
class Employee(model.Model):
6+
name = model.StringProperty()
7+
age = model.IntegerProperty()
8+
9+
10+
@pytest.fixture
11+
def ctx():
12+
ctx = tasklets.get_context()
13+
ctx.set_cache_policy(False)
14+
ctx.set_memcache_policy(False)
15+
return ctx
16+
17+
def test_basics(ctx):
18+
worker = Employee(name='Alice', age=55)
19+
key = worker.put()
20+
same_worker = key.get()
21+
assert worker == same_worker

0 commit comments

Comments
 (0)