<s> from django . core . urlresolvers import reverse <EOL> import pytest <EOL> from tests . utils import dump_json <EOL> pytestmark = pytest . mark . django_db <EOL> def test_basic ( client ) : <EOL> test_data = dump_json ( { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:name>" : "<STR_LIT:test>" , <EOL> } , <EOL> } ) <EOL> output_data = { <EOL> "<STR_LIT:name>" : "<STR_LIT:test>" , <EOL> } <EOL> response = client . generic ( <EOL> "<STR_LIT>" , reverse ( "<STR_LIT>" ) , data = test_data , <EOL> content_type = "<STR_LIT>" ) <EOL> assert response . data == output_data <EOL> def test_multiple ( client ) : <EOL> test_data = dump_json ( { <EOL> "<STR_LIT>" : [ <EOL> { <EOL> "<STR_LIT:name>" : "<STR_LIT>" , <EOL> } , <EOL> { <EOL> "<STR_LIT:name>" : "<STR_LIT>" , <EOL> } , <EOL> ] , <EOL> } ) <EOL> output_data = [ <EOL> { <EOL> "<STR_LIT:name>" : "<STR_LIT>" , <EOL> } , <EOL> { <EOL> "<STR_LIT:name>" : "<STR_LIT>" , <EOL> } , <EOL> ] <EOL> response = client . generic ( <EOL> "<STR_LIT>" , reverse ( "<STR_LIT>" ) , data = test_data , <EOL> content_type = "<STR_LIT>" , <EOL> ) <EOL> assert response . data == output_data <EOL> def test_single_link ( client ) : <EOL> test_data = dump_json ( { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:body>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT:1>" , <EOL> } , <EOL> } , <EOL> } ) <EOL> output_data = { <EOL> "<STR_LIT:body>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> } <EOL> response = client . generic ( <EOL> "<STR_LIT>" , reverse ( "<STR_LIT>" ) , data = test_data , <EOL> content_type = "<STR_LIT>" , <EOL> ) <EOL> assert response . data == output_data <EOL> def test_multiple_link ( client ) : <EOL> test_data = dump_json ( { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : [ "<STR_LIT:1>" , "<STR_LIT:2>" ] , <EOL> } , <EOL> } <EOL> } ) <EOL> output_data = { <EOL> "<STR_LIT:title>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] , <EOL> } <EOL> response = client . generic ( <EOL> "<STR_LIT>" , reverse ( "<STR_LIT>" ) , data = test_data , <EOL> content_type = "<STR_LIT>" , <EOL> ) <EOL> assert response . data == output_data </s>
