File tree 1 file changed +4
-14
lines changed
1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -105,21 +105,11 @@ def test_one(self):
105
105
record = JsonQueryset (model = MetricRecord ).filter (** {'data->two' : 'one' }).first ()
106
106
self .assertIsNone (record )
107
107
108
- record = JsonQueryset (model = MetricRecord ).filter (** {'data->two' : 'two' }).first ()
108
+ records = list (JsonQueryset (model = MetricRecord ).filter (** {'data->two' : 'two' }))
109
+ self .assertEqual (records [0 ].data ['two' ], 'two' )
109
110
110
- # Django 3.1 changes the raw queryset behavior so querybuilder isn't going to change that behavior
111
- if VERSION [0 ] == 3 and VERSION [1 ] == 1 :
112
- self .assertEqual (json .loads (record .data )['two' ], 'two' )
113
- else :
114
- self .assertEqual (record .data ['two' ], 'two' )
115
-
116
- record = JsonQueryset (model = MetricRecord ).filter (** {'data->one' : '1' }).first ()
117
-
118
- # Django 3.1 changes the raw queryset behavior so querybuilder isn't going to change that behavior
119
- if VERSION [0 ] == 3 and VERSION [1 ] == 1 :
120
- self .assertEqual (json .loads (record .data )['one' ], 1 )
121
- else :
122
- self .assertEqual (record .data ['one' ], 1 )
111
+ records = list (JsonQueryset (model = MetricRecord ).filter (** {'data->one' : '1' }))
112
+ self .assertEqual (records [0 ].data ['one' ], 1 )
123
113
124
114
record = JsonQueryset (model = MetricRecord ).filter (** {'data->one' : '2' }).first ()
125
115
self .assertIsNone (record )
You can’t perform that action at this time.
0 commit comments