data.test package

Submodules

data.test.test_models module

class data.test.test_models.TestDataSetFile(methodName='runTest')

Bases: django.test.testcases.TransactionTestCase

Tests the DataSetFileManager class

setUp()
test_get_dataset_files()

Tests retrieving dataset files for a dataset

test_get_datasets()

Tests retrieving datasets for given files

test_get_files()

Tests retrieving files for datasets

class data.test.test_models.TestDataSetManager(methodName='runTest')

Bases: django.test.testcases.TransactionTestCase

setUp()
test_create_dataset()

Tests calling DataSet.create()

test_create_dataset_v6()

Tests calling DataSetManager.create_dataset_v6()

test_filter_datasets()

Tests calling DataSetManager filter_datasets

test_get_datasets_v6()

Tests calling DataSetmanager.get_datasets_v6()

test_get_details_v6()

Tests calling DataSetManager.get_dataset_details()

class data.test.test_models.TestDataSetMemberManager(methodName='runTest')

Bases: django.test.testcases.TransactionTestCase

Tests the DataSetMember class

setUp()
test_create_dataset_members()

Tests calling DataSetManager.create_dataset_members()

test_get_dataset_members_v6()

Tests calling DataSetMemberManager get_dataset_members

test_validate_dataset_members()

Tests calling DataSetManager.validate_data_list()

data.test.test_views module

Tests dataset views methods

class data.test.test_views.TestDataSetPostView(methodName='runTest')

Bases: rest_framework.test.APITestCase

Tests the v6/dataset/ POST API call

api = u'v6'
setUp()
test_add_dataset()

Tests adding a new dataset

test_create_dataset_with_members()

Tests creating a dataset along with a bunch of members

test_invalid_definition()

Tests successfully calling POST with an invalid definition.

class data.test.test_views.TestDataSetValidationView(methodName='runTest')

Bases: rest_framework.test.APITestCase

api = u'v6'
setUp()
test_invalid_definition()

Validates an invalid dataset definition

test_validate_missing_definition()
test_validate_successful()

Tests successfully validating a new dataset using the v6/datasets/validation API

class data.test.test_views.TestDatasetDetailsView(methodName='runTest')

Bases: rest_framework.test.APITestCase

api = u'v6'
setUp()
test_add_dataset_member()

Tests adding a new dataset member

test_add_filter_dataset_members()

Tests adding new dataset members based on a filter

test_add_filter_dataset_members_dry_run()

Tests adding new dataset members based on a filter

test_add_invalid_dataset_member()

Tests adding an invalid new dataset member

test_dataset_details_successful()

Tests successfully calling the v6/datasets/<dataset_id>/ view.

class data.test.test_views.TestDatasetMemberDetailsView(methodName='runTest')

Bases: rest_framework.test.APITestCase

api = u'v6'
setUp()
test_dataset_member_details_successful()

Tests successfully calling the v6/datasets/members/<id>/ view.

class data.test.test_views.TestDatasetMembersView(methodName='runTest')

Bases: rest_framework.test.APITestCase

api = u'v6'
setUp()
test_dataset_members_successful()

Tests successfully calling the v6/datasets/members/<id>/ view.

class data.test.test_views.TestDatasetViews(methodName='runTest')

Bases: rest_framework.test.APITestCase

api = u'v6'
setUp()
test_dataset_id_successful()

Tests successfully calling the v6/datasets/?id= api call

test_dataset_keyword_successful()

Tests successfully calling the v6/datasets/?keyword= api call

test_dataset_time_successful()

Tests successfully calling the v6/datasets api with time filters

test_order_by()

Tests successfully calling the datasets view with sorting.

test_successful()

Tests successfully calling the v6/datasets/ view.

data.test.utils module

Defines utility methods for testing datasets

data.test.utils.create_dataset(title=None, description=None, created=None, definition=None)

Creates a dataset model for unit testing

Parameters:
  • title (string) – The title of the dataset
  • description (string) – The description of the dataset
  • created – The created time of the dataset
  • definition (dict) – The dataset definition
Returns:

The dataset model

Return type:

data.models.DataSet

data.test.utils.create_dataset_members(dataset=None, data_list=None)

Creates a datasetmember model

Parameters:
  • dataset (data.models.DataSet) – The dataset the members are a part of
  • data_list ([dict]) – The data for the members

Module contents