Skip to content

Commit fd6bf48

Browse files
committed
test: Drop collection before feeding test data.
1 parent 50c8792 commit fd6bf48

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

graphene_mongo/tests/fixtures.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@
22

33

44
def setup_fixtures():
5-
print('setup_fixtures' * 10)
5+
Editor.drop_collection()
66
editor1 = Editor(first_name='Penny', last_name='Hardaway')
77
editor1.save()
88
editor2 = Editor(first_name='Grant', last_name='Hill')
99
editor2.save()
1010
editor3 = Editor(first_name='Dennis', last_name='Rodman')
1111
editor3.save()
1212

13-
reporter = Reporter(first_name='Allen', last_name='Iverson',
14-
email='[email protected]', awards=['2010-mvp'])
13+
Article.drop_collection()
1514
article1 = Article(headline='Hello', editor=editor1)
1615
article1.save()
1716
article2 = Article(headline='World', editor=editor2)
1817
article2.save()
1918

19+
Reporter.drop_collection()
20+
reporter = Reporter(first_name='Allen', last_name='Iverson',
21+
email='[email protected]', awards=['2010-mvp'])
2022
reporter.articles = [article1, article2]
2123
reporter.save()
2224

25+
Player.drop_collection()
2326
player1 = Player(first_name='Michael', last_name='Jordan')
2427
player1.save()
2528
player2 = Player(first_name='Magic', last_name='Johnson', opponent=player1)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
version='0.1.4',
66

77
description='Graphene Mongoengine integration',
8-
# long_description=open('README.md').read(),
8+
# long_description=open('README.rst').read(),
99

1010
url='https://github.com/graphql-python/graphene-mongo',
1111

0 commit comments

Comments
 (0)