mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 00:26:33 +00:00
Add Test for Import Limit
This commit is contained in:
parent
32463c1157
commit
3295d419bf
1 changed files with 13 additions and 0 deletions
|
@ -360,3 +360,16 @@ class GenericImporter(TestCase):
|
|||
self.assertFalse(
|
||||
models.Review.objects.filter(book=self.book, user=self.local_user).exists()
|
||||
)
|
||||
|
||||
def test_import_limit(self, *_):
|
||||
"""checks if import limit works"""
|
||||
site_settings = models.SiteSettings.objects.get()
|
||||
site_settings.import_size_limit = 2
|
||||
site_settings.import_limit_reset = 2
|
||||
site_settings.save()
|
||||
|
||||
import_job = self.importer.create_job(
|
||||
self.local_user, self.csv, False, "public"
|
||||
)
|
||||
import_items = models.ImportItem.objects.filter(job=import_job).all()
|
||||
self.assertEqual(len(import_items), 2)
|
||||
|
|
Loading…
Reference in a new issue