Skip to content

Commit

Permalink
refactor: Separate relay test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
abawchen committed Feb 28, 2018
1 parent 7811e49 commit 50c8792
Show file tree
Hide file tree
Showing 3 changed files with 378 additions and 357 deletions.
34 changes: 34 additions & 0 deletions graphene_mongo/tests/fixtures.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from .models import Article, Editor, Player, Reporter


def setup_fixtures():
print('setup_fixtures' * 10)
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'])
article1 = Article(headline='Hello', editor=editor1)
article1.save()
article2 = Article(headline='World', editor=editor2)
article2.save()

reporter.articles = [article1, article2]
reporter.save()

player1 = Player(first_name='Michael', last_name='Jordan')
player1.save()
player2 = Player(first_name='Magic', last_name='Johnson', opponent=player1)
player2.save()
player3 = Player(first_name='Larry', last_name='Bird', players=[player1, player2])
player3.save()

player1.players = [player2]
player1.save()

player2.players = [player1]
player2.save()
Loading

0 comments on commit 50c8792

Please sign in to comment.