{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/4"},{"label":"Unit","url":"https://skillfed.io/packages/category/software-development-testing-unit"},{"label":"Mocking","url":"https://skillfed.io/packages/category/software-development-testing-mocking"}],"enrichment":{"capability":"Mocks Django QuerySet operations in memory for unit testing, supporting filtering, aggregation, field lookups, and CRUD operations without a database.","skillfed_tags":["django-testing","unit-testing","mocking"],"use_cases":["Unit test Django view logic that queries models without setting up a test database","Mock User.objects or other model managers in test patches to verify filter and query logic","Test django-rest-framework serializers with mocked model instances and nested serializers","Speed up test suites by running tests without database setup when database-free testing is feasible","Verify QuerySet method chaining and complex filter combinations with Q objects in isolation"],"what_it_does":"django-mock-queries lets you test Django code that queries models without setting up a database. It provides in-memory MockSet and MockModel classes that mimic Django's QuerySet API, supporting method chaining, filtering with Q objects, aggregates, field lookups, and CRUD operations. This is useful when you want fast unit tests that don't require database setup or migrations.\n\nThe library is typically used by patching Django model managers in test cases, allowing you to verify query logic in isolation. It also includes utilities for testing django-rest-framework serializers and can be configured to run an entire test suite without a database by monkey-patching the test database backend, which can significantly speed up test execution for projects with many migrations.","worth_installing":"Yes. This is a mature, actively maintained testing utility with no dependencies, permissive licensing, and clear use cases for accelerating Django unit tests. Install it if you want to test query logic without database overhead; skip it only if your test suite already has fast database fixtures or you need QuerySet methods not yet supported (annotate, reverse, none, extra, raw, bulk_create, in_bulk, as_manager)."},"id":"django-mock-queries","links":{"html":"https://skillfed.io/packages/django-mock-queries","md":"https://skillfed.io/packages/django-mock-queries.md","pypi":"https://pypi.org/project/django-mock-queries/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2024-09-26","license_spdx":null,"license_treatment":"permissive","name":"django-mock-queries","python_support":"unspecified","summary":"A django library for mocking queryset functions in memory for testing"},"popularity":{"monthly_downloads":204780,"position":9601,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.3.0"}
