Beispiel #1
0
 def test_in_values_list(self):
     from testapp.models import Publisher, Book
     from johnny.cache import get_tables_for_query
     pubs = Publisher.objects.all()
     books = Book.objects.filter(publisher__in=pubs.values_list("id", flat=True))
     tables = list(sorted(get_tables_for_query(books.query)))
     self.assertEqual(["testapp_book", "testapp_publisher"], tables)
Beispiel #2
0
 def test_in_values_list(self):
     pubs = Publisher.objects.all()
     books = Book.objects.filter(publisher__in=pubs.values_list("id", flat=True))
     tables = list(sorted(get_tables_for_query(books.query)))
     self.assertEqual(["testapp_book", "testapp_publisher"], tables)
Beispiel #3
0
 def test_in_values_list(self):
     pubs = Publisher.objects.all()
     books = Book.objects.filter(
         publisher__in=pubs.values_list("id", flat=True))
     tables = list(sorted(get_tables_for_query(books.query)))
     self.assertEqual(["testapp_book", "testapp_publisher"], tables)