Exemple #1
0
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/pickup-dates/'

        # pickup date for group with one member and one store
        cls.member = User()
        cls.group = Group(members=[cls.member, ])
        cls.store = Store(group=cls.group)
        cls.pickup = PickupDate(store=cls.store)
        cls.pickup_url = cls.url + str(cls.pickup.id) + '/'
        cls.join_url = cls.pickup_url + 'add/'
        cls.leave_url = cls.pickup_url + 'remove/'

        # not a member of the group
        cls.user = User()

        # another pickup date for above store
        cls.pickup_data = {'date': timezone.now() + timedelta(days=2),
                           'max_collectors': 5,
                           'store': cls.store.id}

        # past pickup date
        cls.past_pickup_data = {'date': timezone.now() - timedelta(days=1),
                                'max_collectors': 5,
                                'store': cls.store.id}
        cls.past_pickup = PickupDate(store=cls.store, date=timezone.now() - timedelta(days=1))
        cls.past_pickup_url = cls.url + str(cls.past_pickup.id) + '/'
        cls.past_join_url = cls.past_pickup_url + 'add/'
        cls.past_leave_url = cls.past_pickup_url + 'remove/'
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/users/'

        cls.user = User()
        cls.user2 = User()
        cls.group = Group()
        cls.group.members.add(cls.user, cls.user2)
 def setUpClass(cls):
     super().setUpClass()
     cls.user = User()
     cls.user2 = User()
     cls.url = '/api/users/'
     cls.user_data = {
         'display_name': faker.name(),
         'first_name': faker.name(),
         'last_name': faker.name(),
         'email': faker.email(),
         'password': faker.name(),
         'address': faker.address(),
         'latitude': faker.latitude(),
         'longitude': faker.longitude()
     }
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/groups/'

        # some user
        cls.user = User()

        # two groups with different members
        cls.member = User()
        cls.group = Group(members=[
            cls.member,
        ])
        cls.member2 = User()
        cls.group2 = Group(members=[
            cls.member2,
        ])
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/stores/'

        # two groups one store
        cls.member = User()
        cls.group = Group(members=[cls.member, ])
        cls.group2 = Group(members=[cls.member, ])
        cls.store = Store(group=cls.group)
        cls.store2 = Store(group=cls.group2)
 def setUpClass(cls):
     super().setUpClass()
     cls.user = User()
     cls.group = GroupFactory()
     cls.url = '/api/groups/'
     cls.group_data = {
         'name': faker.name(),
         'description': faker.text(),
         'address': faker.address(),
         'latitude': faker.latitude(),
         'longitude': faker.longitude()
     }
Exemple #7
0
 def setUpClass(cls):
     super().setUpClass()
     cls.user = User()
     cls.user2 = User()
     cls.url = '/api/users/'
     cls.user_data = {
         'display_name': faker.name(),
         'first_name': faker.name(),
         'last_name': faker.name(),
         'email': faker.email(),
         'password': faker.name(),
         'address': faker.address(),
         'latitude': faker.latitude(),
         'longitude': faker.longitude()
     }
     cls.group = Group(members=[cls.user, cls.user2])
     cls.another_common_group = Group(members=[cls.user, cls.user2])
     cls.user_in_another_group = User()
     cls.another_group = Group(members=[
         cls.user_in_another_group,
     ])
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/pickup-dates/'

        # pickup date for group with one member and one store
        cls.member = User()
        cls.group = Group(members=[cls.member, ])
        cls.store = Store(group=cls.group)
        cls.pickup = PickupDate(store=cls.store)

        # and another store + group + pick-update
        cls.group2 = Group(members=[cls.member, ])
        cls.store2 = Store(group=cls.group2)
        cls.pickup2 = PickupDate(store=cls.store2)
Exemple #9
0
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/conversations/'

        # A chat with 2 participants
        cls.participant = User()
        cls.participant2 = User()
        cls.conversation = Conversation(
            participants=[cls.participant, cls.participant2])
        cls.conversation_url = cls.url + str(cls.conversation.id) + '/'

        # not a participant
        cls.user = User()

        # another chat
        cls.conversation_data = {
            'topic': faker.name(),
            'with_participants': [
                cls.participant2.id,
            ],
            'message': faker.text()
        }
        cls.patch_data = {'topic': 'new topic'}
        cls.put_data = {'topic': 'new topic'}
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/stores/'

        # group with two members and one store
        cls.member = User()
        cls.member2 = User()
        cls.group = Group(members=[cls.member, cls.member2])
        cls.store = Store(group=cls.group)
        cls.store_url = cls.url + str(cls.store.id) + '/'

        # not a member
        cls.user = User()

        # another store for above group
        cls.store_data = {'name': faker.name(),
                          'description': faker.name(),
                          'group': cls.group.id,
                          'address': faker.address(),
                          'latitude': faker.latitude(),
                          'longitude': faker.longitude()}

        # another group
        cls.different_group = Group(members=[cls.member2, ])
Exemple #11
0
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/users/'

        cls.user = User()
        cls.user2 = User()
Exemple #12
0
 def setUpClass(cls):
     super().setUpClass()
     cls.user = User()
     cls.url = '/api/auth/'
Exemple #13
0
 def setUpClass(cls):
     super().setUpClass()
     cls.group = Group(members=[User() for _ in range(3)])
 def setUpClass(cls):
     super().setUpClass()
     cls.conversation = Conversation(participants=[User() for _ in range(3)])
     [Message(in_conversation=cls.conversation) for _ in range(10)]
Exemple #15
0
 def setUpClass(cls):
     super().setUpClass()
     cls.user = User()