Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no duplication of imported tags (#287) #289

Merged
merged 3 commits into from
Jul 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Revert settings test
  • Loading branch information
sissbruecker committed Jul 3, 2022
commit f4f4c945d75dacd7a6bd38e79536546378f63eda

This file was deleted.

15 changes: 0 additions & 15 deletions bookmarks/tests/test_settings_import_view.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.test import TestCase
from django.urls import reverse

from bookmarks.models import Tag
from bookmarks.tests.helpers import BookmarkFactoryMixin, disable_logging


Expand Down Expand Up @@ -78,17 +77,3 @@ def test_should_show_respective_hints_if_not_all_bookmarks_were_imported_success
self.assertRedirects(response, reverse('bookmarks:settings.general'))
self.assertFormSuccessHint(response, '2 bookmarks were successfully imported')
self.assertFormErrorHint(response, '1 bookmarks could not be imported')

def test_should_import_duplicated_tag_only_once(self):
with open('bookmarks/tests/resources/simple_valid_import_file_with_duplicated_tag.html') as import_file:
response = self.client.post(
reverse('bookmarks:settings.import'),
{'import_file': import_file},
follow=True
)

tag_list = list(Tag.objects.all())
self.assertEqual(len(tag_list), 3, 'wrong number of tags: ' + str(tag_list))
self.assertRedirects(response, reverse('bookmarks:settings.general'))
self.assertFormSuccessHint(response, '3 bookmarks were successfully imported')
self.assertNoFormErrorHint(response)