-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(pg_dump): Add '--if-exists' option for pg_dump (and add tests) #515
base: master
Are you sure you want to change the base?
Conversation
Hi @WillNilges , Added your commit into my initial PR: #511 |
Just a heads up that this test seems to be broken. |
84c017a
to
2e2828d
Compare
Oops, that's my bad. Should work now. |
Marking this as draft due to tests failing |
The following error will need to be resolved Traceback (most recent call last):
File "/home/runner/work/django-dbbackup/django-dbbackup/.tox/py38-django42/lib/python3.8/site-packages/gnupg.py", line 159, in _copy_data
outstream.write(data)
TypeError: a bytes-like object is required, not 'str'
....ERROR Exception: Foo
File "/home/runner/work/django-dbbackup/django-dbbackup/dbbackup/utils.py", line 119, in wrapper
func(*args, **kwargs)
File "/home/runner/work/django-dbbackup/django-dbbackup/dbbackup/tests/test_utils.py", line 81, in func
raise Exception("Foo")
.ERROR Exception: Foo
File "/home/runner/work/django-dbbackup/django-dbbackup/dbbackup/utils.py", line 119, in wrapper
func(*args, **kwargs)
File "/home/runner/work/django-dbbackup/django-dbbackup/dbbackup/tests/test_utils.py", line 91, in func
raise Exception("Foo")
..ERROR Error sending data
Traceback (most recent call last):
File "/home/runner/work/django-dbbackup/django-dbbackup/.tox/py38-django42/lib/python3.8/site-packages/gnupg.py", line 159, in _copy_data
outstream.write(data)
TypeError: a bytes-like object is required, not 'str' Somehow your changes broke @patch("dbbackup.settings.SEND_EMAIL", False)
def test_raise_error_without_mail(self):
def func():
raise Exception("Foo")
with self.assertRaises(Exception):
utils.email_uncaught_exception(func)()
self.assertEqual(len(mail.outbox), 0) Specifically, it seems like Truthfully, I am not sure how your changes could have caused this. |
Description
--if-exists
option forpg_dump
commanddbrestore
fails with non-existent relation #478Extension of #511. If I understand correctly this was precluded on missing a test? I have added it, and was hoping to get this merged so I can use it in production 🙇🏻
Feel free to cherry pick my commit onto @DmytroLitvinov's PR or however you want to do it, I just wanted the feature to move 😅
Checklist
Please update this checklist as you complete each item:
By submitting this pull request I agree that all contributions comply with this project's open source license(s).