def test_table_definition(self): """ Tests that creating a table with capitalized column names succeedso """ create_table(LowercaseKeyModel) create_table(CapitalizedKeyModel) delete_table(LowercaseKeyModel) delete_table(CapitalizedKeyModel)
def test_multiple_deletes_dont_fail(self): """ """ create_table(TestModel) delete_table(TestModel) delete_table(TestModel)
def test_concrete_class_table_creation_cycle(self): """ Tests that models with inherited abstract classes can be created, and have io performed """ from cqlengine.management import create_table, delete_table create_table(ConcreteModelWithCol) w1 = ConcreteModelWithCol.create(pkey=5, data=6) w2 = ConcreteModelWithCol.create(pkey=6, data=7) r1 = ConcreteModelWithCol.get(pkey=5) r2 = ConcreteModelWithCol.get(pkey=6) assert w1.pkey == r1.pkey assert w1.data == r1.data assert w2.pkey == r2.pkey assert w2.data == r2.data delete_table(ConcreteModelWithCol)
def setUpClass(cls): super(BaseQuerySetUsage, cls).setUpClass() delete_table(TestModel) delete_table(IndexedTestModel) create_table(TestModel) create_table(IndexedTestModel) create_table(TestMultiClusteringModel) TestModel.objects.create(test_id=0, attempt_id=0, description='try1', expected_result=5, test_result=30) TestModel.objects.create(test_id=0, attempt_id=1, description='try2', expected_result=10, test_result=30) TestModel.objects.create(test_id=0, attempt_id=2, description='try3', expected_result=15, test_result=30) TestModel.objects.create(test_id=0, attempt_id=3, description='try4', expected_result=20, test_result=25) TestModel.objects.create(test_id=1, attempt_id=0, description='try5', expected_result=5, test_result=25) TestModel.objects.create(test_id=1, attempt_id=1, description='try6', expected_result=10, test_result=25) TestModel.objects.create(test_id=1, attempt_id=2, description='try7', expected_result=15, test_result=25) TestModel.objects.create(test_id=1, attempt_id=3, description='try8', expected_result=20, test_result=20) TestModel.objects.create(test_id=2, attempt_id=0, description='try9', expected_result=50, test_result=40) TestModel.objects.create(test_id=2, attempt_id=1, description='try10', expected_result=60, test_result=40) TestModel.objects.create(test_id=2, attempt_id=2, description='try11', expected_result=70, test_result=45) TestModel.objects.create(test_id=2, attempt_id=3, description='try12', expected_result=75, test_result=45) IndexedTestModel.objects.create(test_id=0, attempt_id=0, description='try1', expected_result=5, test_result=30) IndexedTestModel.objects.create(test_id=1, attempt_id=1, description='try2', expected_result=10, test_result=30) IndexedTestModel.objects.create(test_id=2, attempt_id=2, description='try3', expected_result=15, test_result=30) IndexedTestModel.objects.create(test_id=3, attempt_id=3, description='try4', expected_result=20, test_result=25) IndexedTestModel.objects.create(test_id=4, attempt_id=0, description='try5', expected_result=5, test_result=25) IndexedTestModel.objects.create(test_id=5, attempt_id=1, description='try6', expected_result=10, test_result=25) IndexedTestModel.objects.create(test_id=6, attempt_id=2, description='try7', expected_result=15, test_result=25) IndexedTestModel.objects.create(test_id=7, attempt_id=3, description='try8', expected_result=20, test_result=20) IndexedTestModel.objects.create(test_id=8, attempt_id=0, description='try9', expected_result=50, test_result=40) IndexedTestModel.objects.create(test_id=9, attempt_id=1, description='try10', expected_result=60, test_result=40) IndexedTestModel.objects.create(test_id=10, attempt_id=2, description='try11', expected_result=70, test_result=45) IndexedTestModel.objects.create(test_id=11, attempt_id=3, description='try12', expected_result=75, test_result=45)
def tearDownClass(cls): super(TestQuerying, cls).tearDownClass() delete_table(TestQueryModel)
def tearDownClass(cls): super(TestMinMaxTimeUUIDFunctions, cls).tearDownClass() delete_table(TimeUUIDQueryModel)
def tearDownClass(cls): super(BatchQueryTests, cls).tearDownClass() delete_table(TestMultiKeyModel)
def tearDownClass(cls): super(TestDateTimeQueries, cls).tearDownClass() delete_table(DateTimeQueryTestModel)
def setUpClass(cls): super(TestDeleting, cls).setUpClass() delete_table(TestMultiKeyModel) create_table(TestMultiKeyModel)
def tearDownClass(cls): super(TestUpdating, cls).tearDownClass() delete_table(TestMultiKeyModel)
def setUpClass(cls): super(BatchQueryTests, cls).setUpClass() delete_table(TestMultiKeyModel) create_table(TestMultiKeyModel)
def tearDownClass(cls): super(BaseColumnIOTest, cls).tearDownClass() if not cls.column: return delete_table(cls._generated_model)
def setUp(self): delete_table(PrimaryKeysOnlyModel)
def setUpClass(cls): super(TestCanUpdate, cls).setUpClass() delete_table(TestModel) create_table(TestModel)
def setUpClass(cls): super(TestCounterColumn, cls).setUpClass() delete_table(TestCounterModel) create_table(TestCounterModel)
def tearDownClass(cls): super(TestModelIO, cls).tearDownClass() delete_table(TestModel)
def tearDownClass(cls): super(TestCounterColumn, cls).tearDownClass() delete_table(TestCounterModel)
def tearDownClass(cls): super(TestCanUpdate, cls).tearDownClass() delete_table(TestModel)
def tearDownClass(cls): super(TestDecimal, cls).tearDownClass() delete_table(cls.DecimalTest)
def tearDownClass(cls): super(TestEqualityOperators, cls).tearDownClass() delete_table(TestModel)
def tearDownClass(cls): super(TestTimeUUID, cls).tearDownClass() delete_table(cls.TimeUUIDTest)
def setUpClass(cls): super(TestSetColumn, cls).setUpClass() delete_table(TestSetModel) create_table(TestSetModel)
def tearDownClass(cls): super(TestDatetime, cls).tearDownClass() delete_table(cls.DatetimeTest)
def tearDownClass(cls): super(TestVarInt, cls).tearDownClass() delete_table(cls.VarIntTest)
def tearDownClass(cls): super(BaseQuerySetUsage, cls).tearDownClass() delete_table(TestModel) delete_table(IndexedTestModel) delete_table(TestMultiClusteringModel)
def tearDownClass(cls): super(TestClusteringOrder, cls).tearDownClass() delete_table(TestModel)
def setUpClass(cls): super(TestQuerying, cls).setUpClass() delete_table(TestQueryModel) create_table(TestQueryModel)
def tearDownClass(cls): super(TestSetColumn, cls).tearDownClass() delete_table(TestSetModel)
def setUpClass(cls): super(TestListColumn, cls).setUpClass() delete_table(TestListModel) create_table(TestListModel)
def setUp(self): delete_table(FirstModel)
def tearDownClass(cls): super(TestListColumn, cls).tearDownClass() delete_table(TestListModel)