nansencenter / django-geo-spaas

GeoDjango apps for satellite data management in Geo-Scientific Platform as a Service
GNU General Public License v3.0
20 stars 6 forks source link

relation between dataset and parameter table should be included in tests #87

Closed opsdep closed 4 years ago

opsdep commented 4 years ago

There is a many to many relationship between dataset table and the parameter table. Some tests should be written in order to test the filtering ability of datasets based on specifying the parameters of them. This is working in the Django shell and the tests should assert that this filtering is ok. Thus, tests should consider below notes:

import django os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.project.settings") django.setup()

import geospaas.nansat_ingestor.management.commands.ingest as ingest command = ingest.Command() command.handle(files=["/data/MER_FRS_1PNPDK20120303_093810_000000333112_00180_52349_3561.N1"], nansat_option=[])

import geospaas.nansat_ingestor.management.commands.ingest_thredds_crawl as ingest_thredds_crawl command = ingest_thredds_crawl.Command() command.handle(url=["http://nbstds.met.no/thredds/catalog/NBS/S2A/2017/01/catalog.html"],date = '2017/01/10')

akorosov commented 4 years ago

See Mock docs here: https://docs.python.org/3/library/unittest.mock.html