'Tests that big collections are detected and raise an exception.'

def test_element_count_validation(self):

    while True:
        try:
            TestSetModel.create(text_set=set((str(uuid4()) for i in range(65535))))
            break
        except WriteTimeout:
            (ex_type, ex, tb) = sys.exc_info()
            log.warning('{0}:    {1}    Backtrace:    {2}'.format(ex_type.__name__, ex, traceback.extract_tb(tb)))
            del tb
        except OperationTimedOut:
            self.assertFalse(CASSANDRA_IP.startswith('127.0.0.'))
    self.assertRaises(ValidationError, TestSetModel.create, **{'text_set': set((str(uuid4()) for i in range(65536)))})
