diff --git a/tests/test_fetching.py b/tests/test_fetching.py index dab549d3..86b8733c 100644 --- a/tests/test_fetching.py +++ b/tests/test_fetching.py @@ -271,8 +271,8 @@ def test_sorting_null_field(self): """ person1 = self.Person(id=1) - person2 = self.Person(id=2, name='foo') - person3 = self.Person(id=3, name='bar') + person2 = self.Person(id=2, name=u'foo') + person3 = self.Person(id=3, name=u'bar') person4 = self.Person(id=4) self.session.add_all([person1, person2, person3, person4]) self.session.commit() diff --git a/tests/test_updating.py b/tests/test_updating.py index 59b67b1d..38d5a93b 100644 --- a/tests/test_updating.py +++ b/tests/test_updating.py @@ -122,7 +122,7 @@ def test_wrong_content_type(self): with a :http:status:`415`. """ - person = self.Person(id=1, name='foo') + person = self.Person(id=1, name=u'foo') self.session.add(person) self.session.commit() headers = {'Content-Type': 'application/json'} @@ -138,7 +138,7 @@ def test_wrong_content_type(self): response = self.app.patch('/api/person/1', data=dumps(data), headers=headers) assert response.status_code == 415 - assert person.name == 'foo' + assert person.name == u'foo' def test_wrong_accept_header(self): """Tests that if a client specifies only :http:header:`Accept` @@ -146,7 +146,7 @@ def test_wrong_accept_header(self): with a :http:status:`406`. """ - person = self.Person(id=1, name='foo') + person = self.Person(id=1, name=u'foo') self.session.add(person) self.session.commit() headers = {'Accept': 'application/json'} @@ -162,7 +162,7 @@ def test_wrong_accept_header(self): response = self.app.patch('/api/person/1', data=dumps(data), headers=headers) assert response.status_code == 406 - assert person.name == 'foo' + assert person.name == u'foo' def test_related_resource_url_forbidden(self): """Tests that :http:method:`patch` requests to a related resource URL @@ -331,7 +331,7 @@ def test_rollback_on_integrity_error(self): data = {'data': {'type': 'person', 'id': '2', - 'attributes': {'name': 'foo'} + 'attributes': {'name': u'foo'} } } response = self.app.patch('/api/person/2', data=dumps(data)) @@ -447,7 +447,7 @@ def test_collection_name(self): } response = self.app.patch('/api/people/1', data=dumps(data)) assert response.status_code == 204 - assert person.name == 'foo' + assert person.name == u'foo' def test_different_endpoints(self): """Tests for updating the same resource from different endpoints.""" @@ -464,7 +464,7 @@ def test_different_endpoints(self): } response = self.app.patch('/api/person/1', data=dumps(data)) assert response.status_code == 204 - assert person.name == 'foo' + assert person.name == u'foo' data = {'data': {'type': 'person', 'id': '1', @@ -682,7 +682,7 @@ def test_missing_type(self): response = self.app.patch('/api/person/1', data=dumps(data)) assert response.status_code == 400 # TODO check error message here - assert person.name == 'foo' + assert person.name == u'foo' def test_missing_id(self): """Tests that attempting to update a resource without providing an ID @@ -700,7 +700,7 @@ def test_missing_id(self): response = self.app.patch('/api/person/1', data=dumps(data)) assert response.status_code == 400 # TODO check error message here - assert person.name == 'foo' + assert person.name == u'foo' def test_nonexistent_to_one_link(self): """Tests that an attempt to update a to-one relationship with a @@ -855,7 +855,7 @@ def increment_id(resource_id=None, **kw): } response = self.app.patch('/api/person/0', data=dumps(data)) assert response.status_code == 204 - assert person.name == 'foo' + assert person.name == u'foo' def test_single_resource_processing_exception(self): """Tests for a preprocessor that raises a :exc:`ProcessingException` @@ -885,7 +885,7 @@ def forbidden(**kw): assert len(errors) == 1 error = errors[0] assert 'forbidden' == error['detail'] - assert person.name == 'foo' + assert person.name == u'foo' def test_single_resource(self): """Tests :http:method:`patch` requests for a single resource with a diff --git a/tests/test_validation.py b/tests/test_validation.py index 3c93de77..0694d8e2 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -335,13 +335,13 @@ def test_update_valid(self): error response. """ - person = self.Person(id=1, email='example@example.com') + person = self.Person(id=1, email=u'example@example.com') self.session.add(person) self.session.commit() data = {'data': {'id': '1', 'type': 'person', - 'attributes': {'email': 'foo@example.com'} + 'attributes': {'email': u'foo@example.com'} } } response = self.app.patch('/api/person/1', data=dumps(data)) @@ -353,7 +353,7 @@ def test_update_invalid(self): an error response. """ - person = self.Person(id=1, email='example@example.com') + person = self.Person(id=1, email=u'example@example.com') self.session.add(person) self.session.commit() data = {'data':