Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. diff --git a/pontoon/base/models.py b/pontoon/base/models.py
  2. index d5c353b..38b8a5e 100644
  3. --- a/pontoon/base/models.py
  4. +++ b/pontoon/base/models.py
  5. @@ -1236,34 +1236,23 @@ class EntityQuerySet(models.QuerySet):
  6. )
  7. )
  8.  
  9. - def fuzzy(self, locale):
  10. - return self.with_status_counts(locale).filter(
  11. - Q(fuzzy_count=F('expected_count')) & ~Q(approved_count=F('expected_count'))
  12. - )
  13. + def fuzzy(self):
  14. + return Q(fuzzy_count=F('expected_count')) & ~Q(approved_count=F('expected_count'))
  15.  
  16. --- a/pontoon/base/tests/test_models.py
  17. +++ b/pontoon/base/tests/test_models.py
  18. @@ -1158,7 +1158,10 @@ class EntityFilterTests(TestCase):
  19. fuzzy=True
  20. )
  21.  
  22. - assert_equal({first_entity, third_entity}, set(Entity.objects.fuzzy(self.locale)))
  23. + assert_equal(
  24. + {first_entity, third_entity},
  25. + set(Entity.objects.with_status_counts(self.locale).filter(Entity.objects.fuzzy()))
  26. + )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement