Skip to content

Commit

Permalink
[#642] Fix how the check for separate urls is ignored in legacy mode.
Browse files Browse the repository at this point in the history
I put the check for the legacy mode in this function to make it testable.
  • Loading branch information
domoritz committed Mar 28, 2013
1 parent 302a9ff commit b2f477f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ckanext/datastore/plugin.py
Expand Up @@ -142,8 +142,9 @@ def _get_db_from_url(self, url):

def _same_read_and_write_url(self):
# in legacy mode, this test can be ignored
# because both URLs are set to the same url
if self.legacy_mode:
return True
return False
return self.write_url == self.read_url

def _read_connection_has_correct_privileges(self):
Expand Down
2 changes: 1 addition & 1 deletion ckanext/datastore/tests/test_configure.py
Expand Up @@ -28,7 +28,7 @@ def test_check_separate_write_and_read_if_not_legacy(self):
self.p.legacy_mode = True
self.p.write_url = 'postgresql://u:pass@localhost/ds'
self.p.read_url = 'postgresql://u:pass@localhost/ds'
assert self.p._same_read_and_write_url()
assert not self.p._same_read_and_write_url()

self.p.legacy_mode = False

Expand Down

0 comments on commit b2f477f

Please sign in to comment.