示例#1
0
 def test_can_return_a_journal_based_on_its_code(self):
     # Setup
     code = self.journal.code
     mixin = SingleJournalMixin()
     mixin.kwargs = {'code': code}
     # Run & check
     self.assertEqual(mixin.get_object(), self.journal)
示例#2
0
 def test_can_return_a_journal_based_on_its_code(self):
     # Setup
     code = self.journal.code
     mixin = SingleJournalMixin()
     mixin.kwargs = {"code": code}
     # Run & check
     self.assertEqual(mixin.get_object(), self.journal)
示例#3
0
 def test_returns_http_404_if_the_journal_does_not_exist(self):
     # Setup
     code = self.journal.code
     mixin = SingleJournalMixin()
     mixin.kwargs = {'code': code + 'dummy'}
     # Run & check
     with self.assertRaises(Http404):
         mixin.get_object()
示例#4
0
 def test_returns_http_404_if_the_journal_does_not_exist(self):
     # Setup
     code = self.journal.code
     mixin = SingleJournalMixin()
     mixin.kwargs = {"code": code + "dummy"}
     # Run & check
     with self.assertRaises(Http404):
         mixin.get_object()