pyeve / eve-sqlalchemy

SQLAlchemy data layer for Eve-powered RESTful APIs
http://eve-sqlalchemy.readthedocs.io
Other
232 stars 70 forks source link

ValidatorSQL class doesn't handle/pass allow_unknown #71

Closed lingfish closed 8 years ago

lingfish commented 9 years ago

As per https://github.com/RedTurtle/eve-sqlalchemy/issues/70.

The test isn't spectacular, but you wanted a small one ;)

amleczko commented 9 years ago

travis tests are failing?

lingfish commented 8 years ago

There we go -- mine is fixed, the others aren't my code.

goneri commented 8 years ago

Hi, I pushed a fix for the unit-test and took the liberty to rebase the two patches: https://github.com/goneri/eve-sqlalchemy/tree/bug-70

lingfish commented 8 years ago

Nice find, thanks.

On 02/10/2015 3:22 AM, Gonéri Le Bouder wrote:

It's a constraint failure:

|self = <sqlalchemy.dialects.sqlite.pysqlite.SQLiteDialect_pysqlite object at 0x7f1082107a90> cursor = <sqlite3.Cursor object at 0x7f1082489650> statement = 'INSERT INTO people (_created, _updated, _etag, firstname, lastname, prog, born, title) VALUES (?, ?, ?, ?, ?, ?, ?, ?)' parameters = ('2015-10-01 12:01:30.149928', '2015-10-01 12:01:30.149928', 'da39a3ee5e6b4b0d3255bfef95601890afd80709', 'Kafgpi', 'Mdmokn', 59, ...) context = <sqlalchemy.dialects.sqlite.base.SQLiteExecutionContext object at 0x7f1083242950> def do_execute(self, cursor, statement, parameters, context=None): > cursor.execute(statement, parameters) E IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: people.firstname [SQL: u'INSERT INTO people (_created, _updated, _etag, firstname, lastname, prog, born, title) VALUES (?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: ('2015-10-01 12:01:30.149928', '2015-10-01 12:01:30.149928', 'da39a3ee5e6b4b0d3255bfef95601890afd80709', 'Kafgpi', 'Mdmokn', 59, None, None)] |

It's funny it just appends with this patch.

— Reply to this email directly or view it on GitHub https://github.com/RedTurtle/eve-sqlalchemy/pull/71#issuecomment-144792535.