@@ -113,10 +113,7 @@ def test_create_can_use_guarded_asterisk(self):
113
113
114
114
# An asterisk guarded attribute excludes all fields from mass-assignment.
115
115
# This would raise a DB error if there are any required fields.
116
- self .assertEqual (
117
- sql ,
118
- "INSERT INTO `profiles` (*) VALUES ()" ,
119
- )
116
+ self .assertEqual (sql , "INSERT INTO `profiles` (*) VALUES ()" )
120
117
121
118
def test_bulk_create_can_use_fillable (self ):
122
119
query_builder = ProfileFillable .bulk_create (
@@ -173,8 +170,7 @@ def test_bulk_create_can_use_guarded_asterisk(self):
173
170
# This would obviously raise an invalid SQL syntax error.
174
171
# TODO: Raise a clearer error?
175
172
self .assertEqual (
176
- query_builder .to_sql (),
177
- "INSERT INTO `profiles` () VALUES (), ()" ,
173
+ query_builder .to_sql (), "INSERT INTO `profiles` () VALUES (), ()"
178
174
)
179
175
180
176
def test_update_can_use_fillable (self ):
@@ -214,10 +210,7 @@ def test_update_can_use_guarded_asterisk(self):
214
210
215
211
# An asterisk guarded attribute excludes all fields from mass-assignment.
216
212
# The query builder's sql should not have been altered in any way.
217
- self .assertEqual (
218
- query_builder .to_sql (),
219
- initial_sql ,
220
- )
213
+ self .assertEqual (query_builder .to_sql (), initial_sql )
221
214
222
215
def test_table_name (self ):
223
216
table_name = Profile .get_table_name ()
@@ -250,25 +243,15 @@ def test_serialize_with_hidden(self):
250
243
251
244
def test_serialize_with_visible (self ):
252
245
profile = ProfileSerializeWithVisible .hydrate (
253
- {
254
- "name" : "Joe" ,
255
- "id" : 1 ,
256
- "password" : "secret" ,
257
-
258
- }
246
+ {
"name" :
"Joe" ,
"id" :
1 ,
"password" :
"secret" ,
"email" :
"[email protected] " }
259
247
)
260
248
self .assertTrue (
261
249
{
"name" :
"Joe" ,
"email" :
"[email protected] " },
profile .
serialize ()
262
250
)
263
251
264
252
def test_serialize_with_visible_and_hidden_raise_error (self ):
265
253
profile = ProfileSerializeWithVisibleAndHidden .hydrate (
266
- {
267
- "name" : "Joe" ,
268
- "id" : 1 ,
269
- "password" : "secret" ,
270
-
271
- }
254
+ {
"name" :
"Joe" ,
"id" :
1 ,
"password" :
"secret" ,
"email" :
"[email protected] " }
272
255
)
273
256
with self .assertRaises (AttributeError ):
274
257
profile .serialize ()
0 commit comments