myapp.tests.test_views module

class myapp.tests.test_views.DJATestCase(methodName='runTest')[source]

Bases: rest_framework.test.APITestCase

test cases using Django REST Framework drf-json-api (DJA)

test_post_primary_rel()[source]

I should be able to POST the primary data and relationships together.

test_patch_primary_rel()[source]

Make sure we can PATCH the attributes and relationships

test_patch_rel()[source]

See https://jsonapi.org/format/#crud-updating-resource-relationships

test_page_size()[source]

test rest_framework_json_api.pagination.JsonApiPageNumberPagination: page[size] and page[number]

test keyword search (rest_framework.filters.SearchFilter): filter[all]=keywords

test_filter_fields()[source]

test field search (django_filters.rest_framework.DjangoFilterBackend): filter[<field>]=values

test_filter_fields_union_list()[source]

test field for a list of values (ORed): ?filter[field.in]=ANTB,BIOB,XXXX

test_filter_fields_intersection()[source]

test fields (ANDed): ?filter[subject_area_code]=ANTB&filter[course_number]=1234

test_sparse_fieldsets()[source]

test sparse fieldsets

test_sort()[source]

test sort

test_sort_badfield()[source]

test sort of nonexistent field

test_include()[source]

test include

test toMany relationship and related links for courses.related.course_terms

test toOne relationship and related links for course_terms.related.course

test_permission_course_course_terms()[source]

See if permissions are correctly implemented.

test_permission_course_terms()[source]

confirm that somebody lacks course_terms view permission