@@ -39,6 +39,11 @@ def test_create_model_using_attributes(client):
39
39
assert isinstance (result , snippets .Account )
40
40
41
41
42
+ def test_create_model_using_populate (client ):
43
+ result = snippets .create_model_using_populate ()
44
+ assert isinstance (result , snippets .Account )
45
+
46
+
42
47
def test_demonstrate_model_constructor_type_checking (client ):
43
48
with pytest .raises (datastore_errors .BadValueError ):
44
49
snippets .demonstrate_model_constructor_type_checking ()
@@ -56,6 +61,21 @@ def test_save_model(client):
56
61
assert isinstance (result , snippets .ndb .Key )
57
62
58
63
64
+ def test_get_model (client ):
65
+ sandy_key = snippets .save_model (
66
+ snippets .create_model_using_keyword_arguments ())
67
+ result = snippets .get_model (sandy_key )
68
+ assert isinstance (result , snippets .Account )
69
+
70
+
71
+ def test_get_key_kind_and_id (client ):
72
+ sandy_key = snippets .save_model (
73
+ snippets .create_model_using_keyword_arguments ())
74
+ kind_string , ident = snippets .get_key_kind_and_id (sandy_key )
75
+ assert kind_string == 'Account'
76
+ assert isinstance (ident , long )
77
+
78
+
59
79
def test_get_url_safe_key (client ):
60
80
sandy_key = snippets .save_model (
61
81
snippets .create_model_using_keyword_arguments ())
@@ -121,7 +141,11 @@ def test_demonstrate_models_with_parent_hierarchy(client):
121
141
122
142
123
143
def test_equivalent_ways_to_define_key_with_parent (client ):
124
- result = snippets .equivalent_ways_to_define_key_with_parent ()
144
+ snippets .equivalent_ways_to_define_key_with_parent ()
145
+
146
+
147
+ def test_create_root_key (client ):
148
+ result = snippets .create_root_key ()
125
149
assert result .id () == 'sandy@example.com'
126
150
127
151
0 commit comments