textify.api.tests package

Submodules

textify.api.tests.test_views module

class textify.api.tests.test_views.NoteViewSetTests(methodName='runTest')

Bases: rest_framework.test.APITestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_delete_note_should_fail_unauthorized()

HTTP DELETE to /api/v1/notes/{id} without authorization should fail and return status 401

test_delete_should_success_authorized()

HTTP DELETE to /api/v1/notes/{id} with authorization should delete note and return status 204

test_get_all_notes_authorized()

HTTP GET to /api/v1/notes/ with authorization should return list of all notes with status 200

test_get_all_notes_unauthorized()

HTTP GET to /api/v1/notes/ without authorization should return list of all notes with status 200

test_get_note_should_increase_view_count_authorized()

HTTP GET to /api/v1/notes/{id} with authorization should return note of specified id with status 200 and increase view_counter

test_get_note_should_increase_view_count_unauthorized()

HTTP GET to /api/v1/notes/{id} without authorization should return note of specified id with status 200

test_post_note_create_should_fail_unauthorized()

HTTP POST to /api/v1/notes/ without authorization should fail and return status 401

test_post_note_create_should_success_authorized()

HTTP POST to /api/v1/notes/ with authorization should create note and return status 201

test_put_note_should_fail_unauthorized()

HTTP PUT to /api/v1/notes/{id} without authorization should fail and return status 401

test_put_note_should_success_and_reset_view_count_authorized()

HTTP GET to /api/v1/notes/{id} with authorization should update note of specified id with status 200 and reset view_counter

Module contents