Skip to main content

Efficiently manage and install data fixtures

Project description

https://travis-ci.org/uber/charlatan.png?branch=master

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> Erik Formella <erik@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.6.zip (30.7 kB view details)

Uploaded Source

File details

Details for the file charlatan-0.2.6.zip.

File metadata

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

File hashes

Hashes for charlatan-0.2.6.zip
Algorithm Hash digest
SHA256 bd9f90becd6eef0668bcf054834672094a33eab26dce1ce6f680b8dfade99207
MD5 8efdece751956f1854f5721a83c5e753
BLAKE2b-256 b39c1b7a5270d62f73f47a0f427e777e133357d24bb505e07c39f0c26829f9a0

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