8000 Moved a test to integration in section6. · allyboy08/testing-python-apps@56d16b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 56d16b7

Browse files
committed
Moved a test to integration in section6.
1 parent 76317ee commit 56d16b7

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

section6/video_code/tests/integration/models/store_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55

66
class StoreTest(BaseTest):
7+
def test_create_store(self):
8+
store = StoreModel('test')
9+
self.assertListEqual(store.items.all(), [],
10+
"The store's items length was not 0 even though no items were added.")
11+
712
def test_crud(self):
813
with self.app_context():
914
store = StoreModel('test')
@@ -29,3 +34,15 @@ def test_store_relationship(self):
2934

3035
self.assertEqual(store.items.count(), 1)
3136
self.assertEqual(store.items.first().name, 'test_item')
37+
38+
def test_store_json(self):
39+
store = StoreModel('test')
40+
expected = {
41+
'name': 'test',
42+
'items': []
43+
}
44+
45+
self.assertEqual(
46+
store.json(),
47+
expected,
48+
"The JSON export of the store is incorrect. Received {}, expected {}.".format(store.json(), expected))

section6/video_code/tests/unit/models/store_test.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,3 @@ def test_create_store(self):
88

99
self.assertEqual(store.name, 'test',
1010
"The name of the store after creation does not equal the constructor argument.")
11-
self.assertListEqual(store.items.all(), [],
12-
"The store's items length was not 0 even though no items were added.")
13-
14-
def test_store_json(self):
15-
store = StoreModel('test')
16-
expected = {
17-
'name': 'test',
18-
'items': []
19-
}
20-
21-
self.assertEqual(
22-
store.json(),
23-
expected,
24-
"The JSON export of the store is incorrect. Received {}, expected {}.".format(store.json(), expected))

0 commit comments

Comments
 (0)
0