fast-test-database


Namefast-test-database JSON
Version 0.2.4 PyPI version JSON
download
home_pageNone
SummaryConfigure an in-memory database for running Django tests
upload_time2024-05-07 20:59:57
maintainerNone
docs_urlNone
authorAlexey Kotlyarov
requires_python<4.0,>=3.11
licenseGPL-3.0-or-later
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Fast test database
==================

Use a pure in-memory database for running Django tests.

Usage
-----

In ``settings.py``:

.. code:: python

    from fast_test_database import fast_test_database

    DATABASES = fast_test_database(DATABASES)

    # Or:
    DATABASES = fast_test_database(DATABASES,
                                   test_commands=('test', 'harvest'))

    # Or:
    DATABASES = fast_test_database(DATABASES,
                                   version='5.7')

This will be a no-op except for ``./manage.py test``, when an in-memory
database will be automatically started and supplied to the application.

Details
-------

The in-memory database is a full PostgreSQL or MySQL instance started
using Docker, using tmpfs for storing the data. A single container will
be started if not yet running. It will not be shut down automatically,
and instead reused for subsequent tests.

The type of the database (PostgreSQL or MySQL) is chosen based on the
existing default database engine.

The default version of the database (PostgreSQL or MySQL) is latest.
But it can be specified by version parameter.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "fast-test-database",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "Alexey Kotlyarov",
    "author_email": "a@koterpillar.com",
    "download_url": "https://files.pythonhosted.org/packages/73/81/1579c5ec171c44f51cb11076e5a3a5c5c2557cbc9b36a033cb678d6bb4b6/fast_test_database-0.2.4.tar.gz",
    "platform": null,
    "description": "Fast test database\n==================\n\nUse a pure in-memory database for running Django tests.\n\nUsage\n-----\n\nIn ``settings.py``:\n\n.. code:: python\n\n    from fast_test_database import fast_test_database\n\n    DATABASES = fast_test_database(DATABASES)\n\n    # Or:\n    DATABASES = fast_test_database(DATABASES,\n                                   test_commands=('test', 'harvest'))\n\n    # Or:\n    DATABASES = fast_test_database(DATABASES,\n                                   version='5.7')\n\nThis will be a no-op except for ``./manage.py test``, when an in-memory\ndatabase will be automatically started and supplied to the application.\n\nDetails\n-------\n\nThe in-memory database is a full PostgreSQL or MySQL instance started\nusing Docker, using tmpfs for storing the data. A single container will\nbe started if not yet running. It will not be shut down automatically,\nand instead reused for subsequent tests.\n\nThe type of the database (PostgreSQL or MySQL) is chosen based on the\nexisting default database engine.\n\nThe default version of the database (PostgreSQL or MySQL) is latest.\nBut it can be specified by version parameter.\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Configure an in-memory database for running Django tests",
    "version": "0.2.4",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c0e0ab0ed08883710093ae7d6a71806dec15cb8d906d8729981fe9dadd2eb31",
                "md5": "84a228e47f4da4eb20d0887b51514595",
                "sha256": "15b3c6ff0df5c9592d8db90ab005f71909d589aff2c1e6e2b4f3fcf9cbaf1ba9"
            },
            "downloads": -1,
            "filename": "fast_test_database-0.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "84a228e47f4da4eb20d0887b51514595",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 3259,
            "upload_time": "2024-05-07T20:59:56",
            "upload_time_iso_8601": "2024-05-07T20:59:56.933050Z",
            "url": "https://files.pythonhosted.org/packages/1c/0e/0ab0ed08883710093ae7d6a71806dec15cb8d906d8729981fe9dadd2eb31/fast_test_database-0.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73811579c5ec171c44f51cb11076e5a3a5c5c2557cbc9b36a033cb678d6bb4b6",
                "md5": "659d07849555a5bd4c53f137d2b39951",
                "sha256": "c2c42031b66fe880937001b16030b17ff6349b6a3aec57d535775b73f3f8475a"
            },
            "downloads": -1,
            "filename": "fast_test_database-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "659d07849555a5bd4c53f137d2b39951",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 2840,
            "upload_time": "2024-05-07T20:59:57",
            "upload_time_iso_8601": "2024-05-07T20:59:57.975481Z",
            "url": "https://files.pythonhosted.org/packages/73/81/1579c5ec171c44f51cb11076e5a3a5c5c2557cbc9b36a033cb678d6bb4b6/fast_test_database-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-07 20:59:57",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "fast-test-database"
}
        
Elapsed time: 0.23195s