예제 #1
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.key = 'r3VqnUjxIUI245ns'
     self.groups = [
         self.project,
         #self.create_dataset_with_fields()
     ]
예제 #2
0
    def setUp(self):
        ModelMixin.setUp(self)
        # ZipMediaMixin.setUp(self)
        self.photo1 = self.create_photo_with_media(name="f1",
                                                   tags=self.tags1,
                                                   point=self.point)
        self.photo2 = self.create_photo_with_media(name="f2",
                                                   tags=self.tags2,
                                                   point=self.point)

        self.audio1 = self.create_audio_with_media(name="f1",
                                                   tags=self.tags1,
                                                   point=self.point)
        self.audio2 = self.create_audio_with_media(name="f2",
                                                   tags=self.tags2,
                                                   point=self.point)

        self.dataset = self.create_dataset_with_fields(name="Class Dataset",
                                                       num_fields=9)
        # self.dataset = models.Dataset.objects.get(id=self.dataset.id)  # requery
        self.record1 = self.insert_dataset_data_record(dataset=self.dataset,
                                                       project=self.project,
                                                       geoJSON=mixins.point,
                                                       name='rec1')

        self.urls = {
            # 1 project + 2 photos + 2 audio + 1 record
            '/api/0/projects/{0}/'.format(self.project.id):
            1,
            # 1 project + 2 photos + 2 audio (no records)
            # '/api/0/datasets/{0}/data/{1}/'.format(
            #     self.dataset.id, self.record1.id): 5
            '/api/0/datasets/{0}/data/{1}/'.format(self.dataset.id, self.record1.id):
            1
        }
예제 #3
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.groups = [
         self.project,
         self.create_snapshot(self.user),
         self.create_form_with_fields()
     ]
예제 #4
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.key = 'r3VqnUjxIUI245ns'
     self.groups = [
         self.project,
         #self.create_dataset_with_fields()
     ]
예제 #5
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.key = 'r3VqnUjxIUI245ns'
     self.groups = [
         self.project,
         self.create_snapshot(self.user),
         self.create_form_with_fields()
     ]
예제 #6
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.dataset = self.create_dataset_with_fields(name="Class Dataset",
                                                    num_fields=7)
     self.record1 = self.insert_dataset_data_record(dataset=self.dataset,
                                                    project=self.project,
                                                    geoJSON=mixins.point,
                                                    name='rec1')
     self.url = '/api/0/datasets/%s/data/' % (self.dataset.id)
     self.key = 'dataset_{0}'.format(self.dataset.id)
예제 #7
0
 def setUp(self):
     ModelMixin.setUp(self)
     CSVMixin.setUp(self)
     self.urls = [
         '/api/0/photos/{}/?format=csv'.format(self.photo1.id),
         '/api/0/audio/{}/?format=csv'.format(self.audio1.id),
         '/api/0/map-images/{}/?format=csv'.format(self.map_image1.id),
         '/api/0/projects/{}/?format=csv'.format(self.project1.id),
         '/api/0/prints/{}/?format=csv'.format(self.print1.id)
     ]
     self.isList = False
예제 #8
0
 def setUp(self):
     ModelMixin.setUp(self)
     ZipMediaMixin.setUp(self)
     # just test data types that have media files (skip map images for now
     # because they're auto-processed:
     self.urls = {
         '/api/0/photos/': 2,
         '/api/0/audio/': 2,
         '/api/0/prints/': 2,
         '/api/0/datasets/{}/data/'.format(self.record1.dataset.id): 8
     }
예제 #9
0
 def setUp(self):
     ModelMixin.setUp(self)
     ZipMediaMixin.setUp(self)
     # just test data types that have media files (skip map images for now
     # because they're auto-processed:
     self.urls = {
         '/api/0/photos/': 2,
         '/api/0/audio/': 2,
         '/api/0/prints/': 2,
         '/api/0/forms/{}/data/'.format(self.record1.form.id): 8
     }
예제 #10
0
 def setUp(self):
     ModelMixin.setUp(self)
     CSVMixin.setUp(self)
     self.urls = [
         '/api/0/photos/',
         '/api/0/audio/',
         '/api/0/map-images/',
         '/api/0/markers/',
         '/api/0/projects/',
         '/api/0/prints/'
     ]
     self.isList = True
예제 #11
0
 def setUp(self):
     ModelMixin.setUp(self)
     CSVMixin.setUp(self)
     self.urls = [
         '/api/0/photos/?project_id={0}&format=csv'.format(self.project.id),
         '/api/0/audio/?project_id={0}&format=csv'.format(self.project.id),
         '/api/0/map-images/?project_id={0}&format=csv'.format(
             self.project.id),
         '/api/0/projects/?format=csv',
         '/api/0/prints/?project_id={0}&format=csv'.format(self.project.id)
     ]
     self.isList = True
예제 #12
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.dataset = self.create_dataset_with_fields(
         name="Class Dataset", num_fields=7
     )
     self.record1 = self.insert_dataset_data_record(
         dataset=self.dataset,
         project=self.project,
         geoJSON=mixins.point,
         name='rec1'
     )
     self.url = '/api/0/datasets/%s/data/' % (
         self.dataset.id
     )
     self.key = 'dataset_{0}'.format(self.dataset.id)
    def setUp(self):
        # to set up this test, we'll create 2 datasets that that
        # are owned by self.owner.  A unique, private project
        # will be assigned to each dataset.

        ModelMixin.setUp(self, load_fixtures=False)

        # create 3 users:
        self.users = [self.create_user(username=u) for u in ['u1', 'u2', 'u3']]
        self.owner = self.users[0]
        self.user1 = self.users[1]
        self.user2 = self.users[2]

        # create 2 groups:
        self._create_groups()
예제 #14
0
    def setUp(self):
        # for this test, don't use the default fixtures
        ModelMixin.setUp(self, load_fixtures=False)

        # create 3 users:
        self.users = [self.create_user(username=u) for u in ['u1', 'u2', 'u3']]
        # create 3 projects (1 per user):
        self.projects = []
        for i, user in enumerate(self.users):
            self.projects.append(
                self.create_project(self.users[i],
                                    name='Project #%s' % (i + 1),
                                    authority_id=1))

        # create 3 objects per project:
        self._create_objects()
    def setUp(self):
        # to set up this test, we'll create 2 forms that that
        # are owned by self.owner.  A unique, private project
        # will be assigned to each form.

        ModelMixin.setUp(self, load_fixtures=False)

        # create 3 users:
        self.users = [self.create_user(username=u)
                      for u in ['u1', 'u2', 'u3']]
        self.owner = self.users[0]
        self.user1 = self.users[1]
        self.user2 = self.users[2]

        # create 2 groups:
        self._create_groups()
    def setUp(self):
        # for this test, don't use the default fixtures
        ModelMixin.setUp(self, load_fixtures=False)

        # create 3 users:
        self.users = [self.create_user(username=u)
                      for u in ['u1', 'u2', 'u3']]
        # create 3 projects (1 per user):
        self.projects = []
        for i, user in enumerate(self.users):
            self.projects.append(
                self.create_project(
                    self.users[i],
                    name='Project #%s' % (i + 1),
                    authority_id=1
                )
            )

        # create 3 objects per project:
        self._create_objects()
예제 #17
0
    def setUp(self):
        ModelMixin.setUp(self)
        #ZipMediaMixin.setUp(self)
        self.photo1 = self.create_photo_with_media(name="f1", tags=self.tags1, point=self.point)
        self.photo2 = self.create_photo_with_media(name="f2", tags=self.tags2, point=self.point)
        
        self.audio1 = self.create_audio_with_media(name="f1", tags=self.tags1, point=self.point)
        self.audio2 = self.create_audio_with_media(name="f2", tags=self.tags2, point=self.point)

        self.form = self.create_form_with_fields(name="Class Form", num_fields=8)
        self.form = models.Form.objects.get(id=self.form.id) #requery
        self.records = self.create_records(self.form, 8, photo=self.photo1, audio=self.audio1)
        self.record1 = self.records[0]
        self.record2 = self.records[1]
        
        self.marker1 = self.create_marker(self.user, self.project, name="f1", tags=self.tags1, point=self.point)
        self.marker2 = self.create_marker(self.user, self.project, name="f2", tags=self.tags2, point=self.point)
        
        self.urls = {
            '/api/0/projects/{}/'.format(self.project.id): 15,  # 1 project + 2 photos + 2 audio + 2 markers + 8 records
            '/api/0/markers/{}/'.format(self.marker1.id): 7     # 1 project + 2 photos + 2 audio + 2 records
        }
 def setUp(self):
     ModelMixin.setUp(self)
예제 #19
0
 def setUp(self, load_fixtures=False):
     ModelMixin.setUp(self, load_fixtures=load_fixtures)
예제 #20
0
 def setUp(self, load_fixtures=False):
     ModelMixin.setUp(self, load_fixtures=load_fixtures)
예제 #21
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.groups = [self.project, self.create_view(self.user)]
예제 #22
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.groups = [
         self.project,
         # self.create_dataset_with_fields()
     ]
예제 #23
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.marker = self.create_marker(self.user, self.project, name="Marker 1", geoJSON=mixins.point)
     self.url = '/api/0/markers/%s/' % self.marker.id
예제 #24
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.url = '/api/0/markers/'
예제 #25
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.groups = [
         self.project,
         # self.create_dataset_with_fields()
     ]
 def setUp(self):
     ModelMixin.setUp(self)
예제 #27
0
 def setUp(self):
     ModelMixin.setUp(self)
     self.groups = [
         self.project,
         self.create_view(self.user)
     ]