django-mock-queries icon indicating copy to clipboard operation
django-mock-queries copied to clipboard

A library for mocking django queryset functions in memory for testing

Results 25 django-mock-queries issues
Sort by recently updated
recently updated
newest added

Hi. I'd like to test a model method, while mocking the data of a test instance. Using django wagtail and pytest. models.py ```py class BlockPage(Page): # A wagtail model title...

I don't understand where `self.api.active_users()` is coming from (at the bottom of the example) README: ``` "" Function that queries active users """ def active_users(self): return User.objects.filter(is_active=True).all() """ Test function...

Up to now the README does not explain the "Why?". For you it is 100% clear, but for new developers they might not know the "Why", the benefits. I guess...

I have been decorating my TestCase classes with the `mocked_relations` decorator. Unfortunately I found that setUp is not patched, and even if it is the scope prevents it from reaching...

THE METHOD BEING TESTED: ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ from repo.models import Expert from django.db.models import Q def method_to_test(): experts = Expert.objects.filter(Q(firstname__iregex='^a.*')) return experts ______________________________________________________ ______________________________________________________ THE TEST IMPLEMENTATION: ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ def test_q_expr(experts):...

I'm using django cursor pagination for queryset pagination, and for testing my code I'm using the django-mock-queries package for mock queryset. I get this error when I get page two...

Hi, First of all, thanks for sharing this! Is simply amazing to be able to mock QuerySet in few simple lines! Saying that, I am trying to replicate a `ForeignKey`...

CI tends to currently fail to upload coverage to Codecov and recommends using a token instead: ``` {'detail': ErrorDetail(string='Rate limit reached. Please upload with the Codecov repository upload token to...

_Related to #181_. After introducing changes from #181 to properly mock `MockSet.query`, the following breaks because `utils.get_attribute` doesn't currently handle `Subquery` expressions. ```python ms = MockSet() ms.annotate( my_field=Subquery(ms.filter(value=OuterRef("value"))) ) #...