Beispiel #1
0
    def setUp(self):
        self.client = Client()
        self.user_auth = UserAuthFactory(username="******", password="******",
            email="*****@*****.**")
        self.user_auth.save()
        self.user = UserProfileFactory(user_auth = self.user_auth,
            phone = '0123456789', city = 'Eind')
        self.user.save()

        self.food = FoodFactory()
        self.food.save()

        self.food_chicken = FoodFactory(food_type="Chicken")
        self.food_chicken.save()

        self.event = EventFactory(organizer = self.user)
        self.event.save()
        self.event.food_types.add(self.food)
        self.event.food_types.add(self.food_chicken)

        self.event_date =  str(self.event.event_date)

        self.data = {
            'first_name' : 'Pouya',
            'last_name' : 'Samadi Khah',
            'number_of_guests': '5',
            'beef': '4',
            'pork': '5'
            }
Beispiel #2
0
    def setUp(self):
        self.client = Client()
        self.user_auth = UserAuthFactory(username="******",
                                         password="******",
                                         email="*****@*****.**")
        self.user_auth.save()
        self.user = UserProfileFactory(user_auth=self.user_auth,
                                       phone='0123456789',
                                       city='Eind')
        self.user.save()
        self.event = EventFactory(organizer=self.user)
        self.event.save()

        self.food = FoodFactory()
        self.food.save()

        self.food_chicken = FoodFactory(food_type="Chicken")
        self.food_chicken.save()

        self.food_order_1 = FoodOrderFactory(food=self.food_chicken)
        self.food_order_1.save()

        self.food_order_2 = FoodOrderFactory(food=self.food)
        self.food_order_2.save()

        self.attendee = AttendeeFactory()
        self.attendee.save()

        self.event_attendee = EventAttendeeFactory(event=self.event,
                                                   attendee=self.attendee)
        self.event_attendee.save()

        self.event_attendee.food_orders.add(self.food_order_1)
        self.event_attendee.food_orders.add(self.food_order_2)
Beispiel #3
0
 def setUp(self):
     self.user_auth = UserAuthFactory(username="******", password="******"
             , email="*****@*****.**")
     self.user_auth.save()
     self.user = UserProfileFactory(user_auth = self.user_auth
             , phone = '0123456789', city = 'Eind')
     self.user.save()
     self.client = Client()
     self.factory = RequestFactory()
Beispiel #4
0
    def create_users_factories(self, username, name):
        try:
            user = UserFactory(usename=username,
                               name=name,
                               email=username)
            userprofile = UserProfileFactory(user=user)
        except:
            user = User.objects.get(username=username)

        return user
Beispiel #5
0
    def setUp(self):
        self.client = Client()
        self.user_auth = UserAuthFactory(username="******",
                                         password="******",
                                         email="*****@*****.**")
        self.user_auth.save()
        self.user = UserProfileFactory(user_auth=self.user_auth,
                                       phone='0123456789',
                                       city='Eind')
        self.user.save()
        self.event = EventFactory.create(organizer=self.user)
        self.event.save()

        self.food = FoodFactory()
        self.food.save()

        self.food_chicken = FoodFactory(food_type="Chicken")
        self.food_chicken.save()