fast-test-database


Namefast-test-database JSON
Version 0.2.12 PyPI version JSON
download
home_pageNone
SummaryConfigure an in-memory database for running Django tests
upload_time2024-12-04 17:09:13
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/f9/f4/008c41f51ed7fbfea5ad42e22b821b2ffc747347aff82798caf4bc2b6117/fast_test_database-0.2.12.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.12",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0f31441edd6550b2fd7c69b6da7249ebb88dbcde13a87366f849a21144edb700",
                "md5": "bb15326be977080f00b1be104c224762",
                "sha256": "214b4f41d84e5812c806093ad6e1dc2e259edc14bdf8785cb0866a911aafb095"
            },
            "downloads": -1,
            "filename": "fast_test_database-0.2.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bb15326be977080f00b1be104c224762",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 3268,
            "upload_time": "2024-12-04T17:09:11",
            "upload_time_iso_8601": "2024-12-04T17:09:11.119175Z",
            "url": "https://files.pythonhosted.org/packages/0f/31/441edd6550b2fd7c69b6da7249ebb88dbcde13a87366f849a21144edb700/fast_test_database-0.2.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f9f4008c41f51ed7fbfea5ad42e22b821b2ffc747347aff82798caf4bc2b6117",
                "md5": "7e32ec6cfc1ac312e0a90fe9b78b719c",
                "sha256": "179eea1690205ad4b1a86ec651ee80375981e9ee83cbe095302d1b736438ff76"
            },
            "downloads": -1,
            "filename": "fast_test_database-0.2.12.tar.gz",
            "has_sig": false,
            "md5_digest": "7e32ec6cfc1ac312e0a90fe9b78b719c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 2855,
            "upload_time": "2024-12-04T17:09:13",
            "upload_time_iso_8601": "2024-12-04T17:09:13.077971Z",
            "url": "https://files.pythonhosted.org/packages/f9/f4/008c41f51ed7fbfea5ad42e22b821b2ffc747347aff82798caf4bc2b6117/fast_test_database-0.2.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-04 17:09:13",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "fast-test-database"
}
        
Elapsed time: 0.38301s