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.7.zip (33.9 kB view details)

Uploaded Source

File details

Details for the file charlatan-0.2.7.zip.

File metadata

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

File hashes

Hashes for charlatan-0.2.7.zip
Algorithm Hash digest
SHA256 123dba306edda0ed80efd9e74a3511f4e8e639ea8c34087c8205264fa4577ac1
MD5 0f909bc041e12ad8197b00f93ad25c77
BLAKE2b-256 17fce00716e84bcd0e9ae19d7f2392b46501e4a74b5428b62887ae435ca7ddc9

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