Beispiel #1
0
    def setUpTestData(cls):
        cls.url = '/api/places/'

        # group with two members and one place
        cls.member = UserFactory()
        cls.member2 = UserFactory()
        cls.group = GroupFactory(members=[cls.member, cls.member2])
        cls.place = PlaceFactory(group=cls.group)
        cls.place_url = cls.url + str(cls.place.id) + '/'

        # not a member
        cls.user = UserFactory()

        # another place for above group
        cls.place_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 = GroupFactory(members=[cls.member2])
    def setUp(self):
        self.url = '/api/places/'

        # group with two members and one place
        self.member = UserFactory()
        self.member2 = UserFactory()
        self.group = GroupFactory(members=[self.member, self.member2])
        self.place = PlaceFactory(group=self.group)
        self.place_url = self.url + str(self.place.id) + '/'

        # not a member
        self.user = UserFactory()

        # another place for above group
        self.place_data = {
            'name': faker.name(),
            'description': faker.name(),
            'group': self.group.id,
            'address': faker.address(),
            'latitude': faker.latitude(),
            'longitude': faker.longitude()
        }

        # another group
        self.different_group = GroupFactory(members=[self.member2])
Beispiel #3
0
 def setUp(self):
     self.user = UserFactory()
     self.url = '/api/auth/user/'
     self.user_data = {
         'email': faker.email(),
         'password': faker.name(),
         'display_name': faker.name(),
         'address': faker.address(),
         'latitude': faker.latitude(),
         'longitude': faker.longitude()
     }
     mail.outbox = []
Beispiel #4
0
 def setUp(self):
     self.user = UserFactory()
     self.member = UserFactory()
     self.group = GroupFactory(members=[self.member,
                                        UserFactory()],
                               is_open=True)
     self.url = '/api/groups/'
     self.group_data = {
         'name': faker.name(),
         'description': faker.text(),
         'address': faker.address(),
         'latitude': faker.latitude(),
         'longitude': faker.longitude(),
         'timezone': 'Europe/Berlin'
     }
Beispiel #5
0
 def setUp(self):
     self.user = UserFactory()
     self.member = UserFactory()
     self.group = GroupFactory(members=[self.member], is_open=True)
     self.group_with_password = GroupFactory(password='******', is_open=True)
     self.join_password_url = '/api/groups/{}/join/'.format(self.group_with_password.id)
     self.url = '/api/groups/'
     self.group_data = {
         'name': faker.name(),
         'description': faker.text(),
         'address': faker.address(),
         'latitude': faker.latitude(),
         'longitude': faker.longitude(),
         'timezone': 'Europe/Berlin'
     }
Beispiel #6
0
 def setUp(self):
     self.user = UserFactory()
     self.user.photo = 'photo.jpg'
     self.user.save()
     self.user2 = UserFactory()
     self.url = '/api/users/'
     self.user_data = {
         'email': faker.email(),
         'password': faker.name(),
         'display_name': faker.name(),
         'address': faker.address(),
         'latitude': faker.latitude(),
         'longitude': faker.longitude()
     }
     self.group = GroupFactory(members=[self.user, self.user2])
     self.another_common_group = GroupFactory(members=[self.user, self.user2])
     self.user_in_another_group = UserFactory()
     self.another_group = GroupFactory(members=[self.user_in_another_group])
     mail.outbox = []