mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-12 04:49:25 +00:00
Merge pull request #530 from ae-utbm/redirection_for_barmen
redirect the user directly on counter when barman
This commit is contained in:
@ -148,6 +148,20 @@ class CounterTest(TestCase):
|
||||
)
|
||||
self.assertTrue(response.status_code == 200)
|
||||
|
||||
def test_annotate_has_barman_queryset(self):
|
||||
"""
|
||||
Test if the custom queryset method ``annotate_has_barman``
|
||||
works as intended
|
||||
"""
|
||||
self.sli.counters.clear()
|
||||
self.sli.counters.add(self.foyer, self.mde)
|
||||
counters = Counter.objects.annotate_has_barman(self.sli)
|
||||
for counter in counters:
|
||||
if counter.name in ("Foyer", "MDE"):
|
||||
self.assertTrue(counter.has_annotated_barman)
|
||||
else:
|
||||
self.assertFalse(counter.has_annotated_barman)
|
||||
|
||||
|
||||
class CounterStatsTest(TestCase):
|
||||
def setUp(self):
|
||||
|
Reference in New Issue
Block a user