def testModelFiltering(self):
        users = ({
            'email': 'good@email.com',
            'login': 'goodlogin',
            'firstName': 'First',
            'lastName': 'Last',
            'password': 'goodpassword'
        }, {
            'email': 'regularuser@email.com',
            'login': 'regularuser',
            'firstName': 'First',
            'lastName': 'Last',
            'password': 'goodpassword'
        })
        adminUser, regUser = [
            self.model('user').createUser(**user) for user in users]

        fields = {
            'hidden': 1,
            'read': 1,
            'write': 1,
            'write2': 1,
            'admin': 1,
            'sa': 1
        }
        # Test filter behavior on access controlled model
        fakeAc = self.model('fake_ac').save(fields)
        fakeAc = self.model('fake_ac').setUserAccess(
            fakeAc, regUser, level=AccessType.READ)

        filtered = self.model('fake_ac').filter(fakeAc, adminUser)
        self.assertTrue(filtered in 'sa')
        self.assertTrue('write' in filtered)
        self.assertFalse('hidden' in filtered)

        self.model('fake_ac').exposeFields(
            level=AccessType.READ, fields='hidden')

        filtered = self.model('fake_ac').filter(fakeAc, regUser)
        self.assertTrue('hidden' in filtered)
        self.assertTrue('read' in filtered)
        self.assertFalse('write' in filtered)
        self.assertFalse('admin' in filtered)
        self.assertFalse('sa' in filtered)

        self.model('fake_ac').hideFields(level=AccessType.READ, fields='read')

        fakeAc = self.model('fake_ac').setUserAccess(
            fakeAc, regUser, level=AccessType.ADMIN)

        filtered = self.model('fake_ac').filter(fakeAc, regUser)
        self.assertTrue('hidden' in filtered)
        self.assertTrue('write' in filtered)
        self.assertTrue('admin' in filtered)
        self.assertFalse('read' in filtered)
        self.assertFalse('sa' in filtered)

        # Test Model implementation
        fake = self.model('fake').save(fields)
        filtered = self.model('fake').filter(fake, regUser)
        self.assertEqual(filtered, {'read': 1, '_modelType': 'fake'})

        filtered = self.model('fake').filter(fake, adminUser)
        self.assertEqual(filtered, {
            'read': 1,
            'sa': 1,
            '_modelType': 'fake'
        })
dataset/ETHPy150Open girder/girder/tests/cases/model_test.py/ModelTestCase.testModelFiltering/swapped operands of `in`