File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ def make(self, key):
146
146
populate with random data
147
147
"""
148
148
from datetime import date , timedelta
149
- users = User ().fetch ()['username' ]
149
+ users = [ None , None ] + list ( User ().fetch ()['username' ])
150
150
random .seed ('Amazing Seed' )
151
151
self .insert (
152
152
dict (key ,
@@ -155,7 +155,6 @@ def make(self, key):
155
155
username = random .choice (users ))
156
156
for experiment_id in range (self .fake_experiments_per_subject ))
157
157
158
-
159
158
@schema
160
159
class Trial (dj .Imported ):
161
160
definition = """ # a trial within an experiment
Original file line number Diff line number Diff line change @@ -290,6 +290,15 @@ def test_pandas_fetch_and_restriction():
290
290
assert_true (isinstance (df , pandas .DataFrame ))
291
291
assert_equal (len (E & q ), len (E & df ))
292
292
293
+ @staticmethod
294
+ def test_restriction_by_null ():
295
+ assert_true (len (Experiment & 'username is null' ) > 0 )
296
+ assert_true (len (Experiment & 'username is not null' ) > 0 )
297
+
298
+ @staticmethod
299
+ def test_restriction_between (): # see issue
300
+ assert_true (len (Experiment & 'username between "S" and "Z"' ) < len (Experiment ()))
301
+
293
302
@staticmethod
294
303
def test_restrictions_by_lists ():
295
304
x = D ()
You can’t perform that action at this time.
0 commit comments