|
@@ -191,92 +191,6 @@ class DataSourceTestCase(TestCase):
|
191
|
191
|
'joins':None, #Expected call on Query.__call__ (called when we call left_join)
|
192
|
192
|
}
|
193
|
193
|
),
|
194
|
|
- # call Article.select(fields = ['lodel_id', 'titre'], filters = ['lodel_id = 42'])
|
195
|
|
- (
|
196
|
|
- {
|
197
|
|
- 'leobject': [lodel_id],
|
198
|
|
- 'leclass': ['titre'],
|
199
|
|
- },
|
200
|
|
- {
|
201
|
|
- 'target_cls': Article,
|
202
|
|
- 'filters': [ (lodel_id, '=', 42) ],
|
203
|
|
- 'rel_filters': [],
|
204
|
|
- },
|
205
|
|
- {
|
206
|
|
- 'where': {
|
207
|
|
- (
|
208
|
|
- db_utils.column_prefix(table_names[LeObject], lodel_id),
|
209
|
|
- '=',
|
210
|
|
- ): 42
|
211
|
|
- },
|
212
|
|
- 'joins': call(
|
213
|
|
- table_names[Article],
|
214
|
|
- {join_lodel_id: cls_lodel_id(Article)}
|
215
|
|
- ),
|
216
|
|
- }
|
217
|
|
- ),
|
218
|
|
- # call Article.select(fields = ['lodel_id', 'titre'], filters = ['lodel_id = 42', 'soustitre = "foobar"'])
|
219
|
|
- (
|
220
|
|
- {
|
221
|
|
- 'leobject': [lodel_id],
|
222
|
|
- 'leclass': ['titre'],
|
223
|
|
- },
|
224
|
|
- {
|
225
|
|
- 'target_cls': Article,
|
226
|
|
- 'filters': [
|
227
|
|
- (lodel_id, '=', 42),
|
228
|
|
- ('soustitre', '=', 'foobar'),
|
229
|
|
- ],
|
230
|
|
- 'rel_filters': [],
|
231
|
|
- },
|
232
|
|
- {
|
233
|
|
- 'where': {
|
234
|
|
- (
|
235
|
|
- db_utils.column_prefix(table_names[LeObject], lodel_id),
|
236
|
|
- '=',
|
237
|
|
- ): 42,
|
238
|
|
- (
|
239
|
|
- db_utils.column_prefix(table_names[Article], 'soustitre'),
|
240
|
|
- '=',
|
241
|
|
- ): 'foobar',
|
242
|
|
- },
|
243
|
|
- 'joins': call(
|
244
|
|
- table_names[Article],
|
245
|
|
- {join_lodel_id: cls_lodel_id(Article)}
|
246
|
|
- ),
|
247
|
|
- }
|
248
|
|
- ),
|
249
|
|
- # call Textes.select(fields = ['lodel_id', 'titre'], filters = ['lodel_id = 42', 'soustitre = "foobar"'])
|
250
|
|
- (
|
251
|
|
- {
|
252
|
|
- 'leobject': [lodel_id],
|
253
|
|
- 'leclass': ['titre'],
|
254
|
|
- },
|
255
|
|
- {
|
256
|
|
- 'target_cls': Article,
|
257
|
|
- 'filters': [
|
258
|
|
- (lodel_id, '=', 42),
|
259
|
|
- ('soustitre', '=', 'foobar'),
|
260
|
|
- ],
|
261
|
|
- 'rel_filters': [],
|
262
|
|
- },
|
263
|
|
- {
|
264
|
|
- 'where': {
|
265
|
|
- (
|
266
|
|
- db_utils.column_prefix(table_names[LeObject], lodel_id),
|
267
|
|
- '=',
|
268
|
|
- ): 42,
|
269
|
|
- (
|
270
|
|
- db_utils.column_prefix(table_names[Textes], 'soustitre'),
|
271
|
|
- '=',
|
272
|
|
- ): 'foobar',
|
273
|
|
- },
|
274
|
|
- 'joins': call(
|
275
|
|
- table_names[Textes],
|
276
|
|
- {join_lodel_id: cls_lodel_id(Textes)}
|
277
|
|
- ),
|
278
|
|
- }
|
279
|
|
- ),
|
280
|
194
|
]
|
281
|
195
|
|
282
|
196
|
# mock the database module to avoid connection tries
|