def test_sync_db_and_registry(self): def check(): views._sync_db_and_registry(qs, 1) eq_(qs.count(), len(registry)) modules = qs.values_list('module', flat=True) eq_(set(modules), set(registry.keys())) qs = DiscoveryModule.objects.no_cache().filter(app=1) eq_(qs.count(), 0) # All our modules get added. check() # The deleted module is removed. registry.popitem() check()
def test_sync_db_and_registry(self): def check(): views._sync_db_and_registry(qs, 1) eq_(qs.count(), len(registry)) modules = qs.values_list('module', flat=True) eq_(set(modules), set(registry.keys())) qs = DiscoveryModule.objects.no_cache().filter(app=1) eq_(qs.count(), 0) # All our modules get added. check() # The deleted module is removed. registry.popitem() check()
def test_sync_db_and_registry(self): def check(): views._sync_db_and_registry(qs, app) eq_(qs.count(), len(registry)) modules = qs.values_list("module", flat=True) eq_(set(modules), set(registry.keys())) app = Application.objects.create() qs = DiscoveryModule.uncached.filter(app=app) eq_(qs.count(), 0) # All our modules get added. check() # The deleted module is removed. registry.popitem() check()