'Tests the use of context queries with the default model keyspsace
@since 3.6
@jira_ticket PYTHON-598
@expected_result default keyspace should be used
@test_category query'

def test_default_keyspace(self):

    for i in range(5):
        TestModel.objects.create(partition=i, cluster=i)
    with ContextQuery(TestModel) as tm:
        self.assertEqual(5, len(tm.objects.all()))
    with ContextQuery(TestModel, keyspace='ks1') as tm:
        self.assertEqual(5, len(tm.objects.all()))
    for ks in self.KEYSPACES[1:]:
        with ContextQuery(TestModel, keyspace=ks) as tm:
            self.assertEqual(0, len(tm.objects.all()))
