'test for materialized view metadata creation
test_materialized_view_metadata_creation tests that materialized view metadata properly created implicitly in
both keyspace and table metadata under "views". It creates a simple base table and then creates a view based
on that table. It then checks that the materialized view metadata is contained in the keyspace and table
metadata. Finally, it checks that the keyspace_name and the base_table_name in the view metadata is properly set.
@since 3.0.0
@jira_ticket PYTHON-371
@expected_result Materialized view metadata in both the ks and table should be created with a new view is created.
@test_category metadata'

def test_materialized_view_metadata_creation(self):

    self.assertIn('mv1', self.cluster.metadata.keyspaces[self.keyspace_name].views)
    self.assertIn('mv1', self.cluster.metadata.keyspaces[self.keyspace_name].tables[self.function_table_name].views)
    self.assertEqual(self.keyspace_name, self.cluster.metadata.keyspaces[self.keyspace_name].tables[self.function_table_name].views['mv1'].keyspace_name)
    self.assertEqual(self.function_table_name, self.cluster.metadata.keyspaces[self.keyspace_name].tables[self.function_table_name].views['mv1'].base_table_name)
