Traceback (most recent call last):


 "/Users/ken/Developer/projects/2018/parenting-service/library/tests.py", line 79, in test_smart_album

self.assertEqual(stories.count(), samples.count())


 "/Users/ken/Developer/projects/2018/parenting-service/.direnv/python-3.6.1/lib/python3.6/site-packages/django/db/models/query.py", line 387, in count

return self.query.get_count(using=self.db)


 "/Users/ken/Developer/projects/2018/parenting-service/.direnv/python-3.6.1/lib/python3.6/site-packages/django/db/models/sql/query.py", line 491, in get_count

number = obj.get_aggregation(using, ['__count'])['__count']


 "/Users/ken/Developer/projects/2018/parenting-service/.direnv/python-3.6.1/lib/python3.6/site-packages/django/db/models/sql/query.py", line 476, in get_aggregation

result = compiler.execute_sql(SINGLE)


 "/Users/ken/Developer/projects/2018/parenting-service/.direnv/python-3.6.1/lib/python3.6/site-packages/cachalot/monkey_patch.py", line 32, in inner

return original(compiler, *args, **kwargs)


 "/Users/ken/Developer/projects/2018/parenting-service/.direnv/python-3.6.1/lib/python3.6/site-packages/cachalot/monkey_patch.py", line 79, in inner

table_cache_keys = _get_table_cache_keys(compiler)


 "/Users/ken/Developer/projects/2018/parenting-service/.direnv/python-3.6.1/lib/python3.6/site-packages/cachalot/utils.py", line 187, in _get_table_cache_keys

for t in _get_tables(db_alias, compiler.query)]


 "/Users/ken/Developer/projects/2018/parenting-service/.direnv/python-3.6.1/lib/python3.6/site-packages/cachalot/utils.py", line 164, in _get_tables

tables.update(_get_tables(db_alias, subquery))


 "/Users/ken/Developer/projects/2018/parenting-service/.direnv/python-3.6.1/lib/python3.6/site-packages/cachalot/utils.py", line 163, in _get_tables

for subquery in _find_subqueries_in_where(query.where.children):


 "/Users/ken/Developer/projects/2018/parenting-service/.direnv/python-3.6.1/lib/python3.6/site-packages/cachalot/utils.py", line 112, in _find_subqueries_in_where

rhs = child.rhs
AttributeError: 'ExtraJoinRestriction' object has no attribute 'rhs'

Traceback (most recent call last):


 "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 600, in urlopen

chunked=chunked)


 "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 354, in _make_request

conn.request(method, url, **httplib_request_kw)


 "/usr/lib/python3.6/http/client.py", line 1239, in request

self._send_request(method, url, body, headers, encode_chunked)


 "/usr/lib/python3.6/http/client.py", line 1285, in _send_request

self.endheaders(body, encode_chunked=encode_chunked)


 "/usr/lib/python3.6/http/client.py", line 1234, in endheaders

self._send_output(message_body, encode_chunked=encode_chunked)


 "/usr/lib/python3.6/http/client.py", line 1026, in _send_output

self.send(msg)


 "/usr/lib/python3.6/http/client.py", line 964, in send

self.connect()


 "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 196, in connect

conn = self._new_conn()


 "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 180, in _new_conn

self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f6ed533f6d8>: Failed to establish a new connection: [Errno 111] Connection refused
