From 13dd449199b83cf222ad2b87c3a833914611f139 Mon Sep 17 00:00:00 2001 From: J-E Castagnede Date: Wed, 15 May 2024 14:38:20 +0200 Subject: [PATCH] add tests --- georiviere/river/tests/test_managers.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 georiviere/river/tests/test_managers.py diff --git a/georiviere/river/tests/test_managers.py b/georiviere/river/tests/test_managers.py new file mode 100644 index 00000000..a58d77ed --- /dev/null +++ b/georiviere/river/tests/test_managers.py @@ -0,0 +1,15 @@ +from django.test import TestCase + +from georiviere.river.models import Stream +from georiviere.river.tests.factories import StreamFactory + + +class RiverManagerTestCase(TestCase): + @classmethod + def setUpTestData(cls): + StreamFactory.create_batch(5) + + def test_truncate(self): + self.assertEqual(Stream.objects.count(), 5) + Stream.objects.truncate() + self.assertEqual(Stream.objects.count(), 0)