Skip to content

Commit

Permalink
test: Drop collection before feeding test data.
Browse files Browse the repository at this point in the history
  • Loading branch information
abawchen committed Mar 1, 2018
1 parent 50c8792 commit fd6bf48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions graphene_mongo/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,27 @@


def setup_fixtures():
print('setup_fixtures' * 10)
Editor.drop_collection()
editor1 = Editor(first_name='Penny', last_name='Hardaway')
editor1.save()
editor2 = Editor(first_name='Grant', last_name='Hill')
editor2.save()
editor3 = Editor(first_name='Dennis', last_name='Rodman')
editor3.save()

reporter = Reporter(first_name='Allen', last_name='Iverson',
email='ai@gmail.com', awards=['2010-mvp'])
Article.drop_collection()
article1 = Article(headline='Hello', editor=editor1)
article1.save()
article2 = Article(headline='World', editor=editor2)
article2.save()

Reporter.drop_collection()
reporter = Reporter(first_name='Allen', last_name='Iverson',
email='ai@gmail.com', awards=['2010-mvp'])
reporter.articles = [article1, article2]
reporter.save()

Player.drop_collection()
player1 = Player(first_name='Michael', last_name='Jordan')
player1.save()
player2 = Player(first_name='Magic', last_name='Johnson', opponent=player1)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
version='0.1.4',

description='Graphene Mongoengine integration',
# long_description=open('README.md').read(),
# long_description=open('README.rst').read(),

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

Expand Down

0 comments on commit fd6bf48

Please sign in to comment.