コード例 #1
0
    def handle(self, *args, **options):
        create_counter = int(time.time())
        create_quest._created = create_counter
        create_user._created = create_counter

        user = User.objects.get(username=args[0])

        other_users = [create_user() for i in range(10)]
        user_quests = [create_quest(owner=user, max_heroes=10) for i in range(3)]

        for quest in user_quests:
            for other in random.sample(other_users, random.randint(1,5)):
                quest.adventure_state(other).apply()

        other_quests = [create_quest(max_heroes=10) for i in range(5)]
        for quest in other_quests:
            quest.adventure_state(user).apply()
            for other in random.sample(other_users, random.randint(1,5)):
                quest.adventure_state(other).apply()
コード例 #2
0
ファイル: tests.py プロジェクト: youarehero/youarehero
 def setUp(self):
     self.client = Client()
     self.user = create_user()
     self.logged_in = self.client.login(**self.user.credentials)
コード例 #3
0
ファイル: models.py プロジェクト: RaphaelKimmig/youarehero
 def setUp(self):
     self.quest = factories.create_quest()
     self.adventure = factories.create_adventure(self.quest)
     self.applicant = factories.create_user()