Example #1
0
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/users/'

        cls.user = UserFactory()
        cls.user2 = UserFactory()
        cls.group = Group()
        cls.group.members.add(cls.user, cls.user2)
Example #2
0
 def setUpClass(cls):
     super().setUpClass()
     cls.user = UserFactory()
     cls.exampleuser = {
         'display_name': 'bla',
         'email': '*****@*****.**',
         'password': '******'
     }
Example #3
0
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/groups/'

        # some user
        cls.user = UserFactory()

        # two groups with different members
        cls.member = UserFactory()
        cls.group = Group(members=[
            cls.member,
        ])
        cls.member2 = UserFactory()
        cls.group2 = Group(members=[
            cls.member2,
        ])
        cls.empty_group = Group()
 def setUpClass(cls):
     super().setUpClass()
     cls.user = UserFactory()
     cls.member = UserFactory()
     cls.group = GroupFactory(members=[
         cls.member,
     ])
     cls.group_with_password = GroupFactory(password='******')
     cls.join_password_url = '/api/groups/{}/join/'.format(
         cls.group_with_password.id)
     cls.url = '/api/groups/'
     cls.group_data = {
         'name': faker.name(),
         'description': faker.text(),
         'address': faker.address(),
         'latitude': faker.latitude(),
         'longitude': faker.longitude()
     }
 def setUpClass(cls):
     super().setUpClass()
     cls.user = UserFactory()
     cls.user2 = UserFactory()
     cls.verified_user = VerifiedUserFactory()
     cls.url = '/api/users/'
     cls.user_data = {
         'email': faker.email(),
         'password': faker.name(),
         'display_name': 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 = UserFactory()
     cls.another_group = Group(members=[
         cls.user_in_another_group,
     ])
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/stores/'

        # two groups one store
        cls.member = UserFactory()
        cls.group = Group(members=[
            cls.member,
        ])
        cls.group2 = Group(members=[
            cls.member,
        ])
        cls.store = Store(group=cls.group)
        cls.store2 = Store(group=cls.group2)
Example #7
0
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/stores/'

        # group with two members and one store
        cls.member = UserFactory()
        cls.member2 = UserFactory()
        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 = UserFactory()

        # 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, ])
Example #8
0
    def setUpClass(cls):
        super().setUpClass()
        cls.url = '/api/pickup-dates/'

        # pickup date for group with one member and one store
        cls.member = UserFactory()
        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 = UserFactory()

        # 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/conversations/'

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

        # not a participant
        cls.user = UserFactory()

        # 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/pickup-dates/'

        # pickup date for group with one member and one store
        cls.member = UserFactory()
        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)
Example #11
0
 def setUpClass(cls):
     super().setUpClass()
     cls.conversation = Conversation(participants=[UserFactory() for _ in range(3)])
     [Message(in_conversation=cls.conversation) for _ in range(10)]
 def setUpClass(cls):
     super().setUpClass()
     cls.user = UserFactory()
Example #13
0
 def setUpClass(cls):
     super().setUpClass()
     cls.user = UserFactory()
     cls.disabled_user = UserFactory(is_active=False)
     cls.url = '/api/auth/'
 def setUpClass(cls):
     super().setUpClass()
     cls.user = UserFactory()
     cls.url = '/api/users/'
     cls.data = {'password': '******'}
Example #15
0
 def setUpClass(cls):
     super().setUpClass()
     cls.group = Group(members=[UserFactory() for _ in range(3)])