# Path: psqlextra/models/partitioned.py
# class PostgresPartitionedModel(
#     PostgresModel, metaclass=PostgresPartitionedModelMeta
# ):
#     """Base class for taking advantage of PostgreSQL's 11.x native support for
#     table partitioning."""
# 
#     class Meta:
#         abstract = True
#         base_manager_name = "objects"
# 
# Path: psqlextra/types.py
# class PostgresPartitioningMethod(StrEnum):
#     """Methods of partitioning supported by PostgreSQL 11.x native support for
#     table partitioning."""
# 
#     RANGE = "range"
#     LIST = "list"
#     HASH = "hash"
# 
# Path: tests/fake_model.py
# def define_fake_partitioned_model(
#     fields=None, partitioning_options={}, meta_options={}
# ):
#     """Defines a fake partitioned model."""
# 
#     model = define_fake_model(
#         fields=fields,
#         model_base=PostgresPartitionedModel,
#         meta_options=meta_options,
#         PartitioningMeta=type(
#             "PartitioningMeta", (object,), partitioning_options
#         ),
#     )
# 
#     return model


from psqlextra.models import PostgresPartitionedModel
from psqlextra.types import PostgresPartitioningMethod
from .fake_model import define_fake_partitioned_model
    """Tests whether :see:PostgresPartitionedModel is abstract."""

    assert PostgresPartitionedModel._meta.abstract


def test_partitioning_model_options_meta():
    """Tests whether the `_partitioning_meta` attribute is available on the
    class (created by the meta class) and not just creating when the model is
    instantiated."""

    assert PostgresPartitionedModel._partitioning_meta


def test_partitioned_model_default_options():
    """Tests whether the default partitioning options are set as expected on.

    :see:PostgresPartitionedModel.
    """

    model = define_fake_partitioned_model()

    assert model._partitioning_meta.method == PostgresPartitioningMethod.RANGE
    assert model._partitioning_meta.key == []


def test_partitioned_model_method_option():
    """Tests whether the `method` partitioning option is properly copied onto
    the options object."""

    model = define_fake_partitioned_model(

# Path: psqlextra/models/partitioned.py
# class PostgresPartitionedModel(
#     PostgresModel, metaclass=PostgresPartitionedModelMeta
# ):
#     """Base class for taking advantage of PostgreSQL's 11.x native support for
#     table partitioning."""
# 
#     class Meta:
#         abstract = True
#         base_manager_name = "objects"
# 
# Path: psqlextra/types.py
# class PostgresPartitioningMethod(StrEnum):
#     """Methods of partitioning supported by PostgreSQL 11.x native support for
#     table partitioning."""
# 
#     RANGE = "range"
#     LIST = "list"
#     HASH = "hash"
# 
# Path: tests/fake_model.py
# def define_fake_partitioned_model(
#     fields=None, partitioning_options={}, meta_options={}
# ):
#     """Defines a fake partitioned model."""
# 
#     model = define_fake_model(
#         fields=fields,
#         model_base=PostgresPartitionedModel,
#         meta_options=meta_options,
#         PartitioningMeta=type(
#             "PartitioningMeta", (object,), partitioning_options
#         ),
#     )
# 
#     return model


# Path: tests/test_partitioned_model.py
from psqlextra.models import PostgresPartitionedModel
from psqlextra.types import PostgresPartitioningMethod
from .fake_model import define_fake_partitioned_model

    """Tests whether :see:PostgresPartitionedModel is abstract."""

    assert PostgresPartitionedModel._meta.abstract


def test_partitioning_model_options_meta():
    """Tests whether the `_partitioning_meta` attribute is available on the
    class (created by the meta class) and not just creating when the model is
    instantiated."""

    assert PostgresPartitionedModel._partitioning_meta


def test_partitioned_model_default_options():
    """Tests whether the default partitioning options are set as expected on.

    :see:PostgresPartitionedModel.
    """

    model = define_fake_partitioned_model()

    assert model._partitioning_meta.method == PostgresPartitioningMethod.RANGE
    assert model._partitioning_meta.key == []


def test_partitioned_model_method_option():
    """Tests whether the `method` partitioning option is properly copied onto
    the options object."""

    model = define_fake_partitioned_model(

        partitioning_options=dict(method=PostgresPartitioningMethod.LIST)