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: uber.github.io/charlatan

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

For now, you need to install charlatan by adding the following to your requirements.txt:

-e git+git@github.com:uber/charlatan.git#egg=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.2.zip (26.8 kB view details)

Uploaded Source

File details

Details for the file charlatan-0.2.2.zip.

File metadata

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

File hashes

Hashes for charlatan-0.2.2.zip
Algorithm Hash digest
SHA256 a627253f93c8a119bef0e177602fc09ccbd7a53d6bd5b2adeb9a128fb8b1b5c3
MD5 b44c96d6bf78e368fd0319962f338268
BLAKE2b-256 be8cbc97d689aabfda9151ed10867276c4a3af1e72ff5736b0ac3c6927228e97

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