File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,21 @@ def test_one(self):
114
114
self .assertEqual (record .data ['two' ], 'two' )
115
115
116
116
record = JsonQueryset (model = MetricRecord ).filter (** {'data->one' : '1' }).first ()
117
- self .assertEqual (record .data ['one' ], 1 )
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 )
118
123
119
124
record = JsonQueryset (model = MetricRecord ).filter (** {'data->one' : '2' }).first ()
120
125
self .assertIsNone (record )
121
126
122
127
records = list (JsonQueryset (model = MetricRecord ).order_by ('data->one' ))
123
- self .assertEqual (records [0 ].data ['one' ], 1 )
124
- self .assertEqual (records [1 ].data ['one' ], 5 )
128
+ # Django 3.1 changes the raw queryset behavior so querybuilder isn't going to change that behavior
129
+ if VERSION [0 ] == 3 and VERSION [1 ] == 1 :
130
+ self .assertEqual (json .loads (records [0 ].data )['one' ], 1 )
131
+ self .assertEqual (json .loads (records [1 ].data )['one' ], 5 )
132
+ else :
133
+ self .assertEqual (records [0 ].data ['one' ], 1 )
134
+ self .assertEqual (records [1 ].data ['one' ], 5 )
You can’t perform that action at this time.
0 commit comments