Skip to main content

Efficiently manage and install data fixtures

Project description

Efficiently manage and install data fixtures

Charlatan is a library that you can use in your tests to create database fixtures. Its aim is to provide a pragmatic interface that focuses on making it simple to define and install fixtures for your tests. It is also agnostic in so far as even though it’s designed to work out of the box with SQLAlchemy models, it can work with pretty much anything else.

Documentation

Latest documentation: charlatan.readthedocs.org/en/latest/

Getting started

import unittest

from toaster.models import db_session

import charlatan

charlatan.load("./tests/data/fixtures.yaml",
               models_package="toaster.models",
               db_session=db_session)


class TestToaster(unittest.TestCase, charlatan.FixturesManagerMixin):

    def setUp(self):
        self.clean_fixtures_cache()
        self.install_fixtures(("toaster", "user"))

    def test_toaster(self):
        """Verify that toaster can toast."""

        self.toaster.toast()

Installation

Using pip:

pip install charlatan

License

charlatan is available under the MIT License.

Copyright Uber 2013, Charles-Axel Dein <charles@uber.com>

Authors

Charles-Axel Dein <charles@uber.com>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charlatan-0.2.3.zip (26.6 kB view details)

Uploaded Source

File details

Details for the file charlatan-0.2.3.zip.

File metadata

  • Download URL: charlatan-0.2.3.zip
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for charlatan-0.2.3.zip
Algorithm Hash digest
SHA256 58f377d43542360f44ea9e5a00e810a607969b1619b9eec80e3254a83cd787c7
MD5 b287dfef410f6c9421de08f0f02035d4
BLAKE2b-256 4fc2bc5ed89b90ceb66baa913833bdeb514a655cc0ca6315304529c22b1653b2

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page