Exemple #1
0
 def test_create_basic_title_queue_state_prio_customer_four(self):
     tic = Ticket.create_basic(Title='foobar',
                               Queue='raw',
                               StateID='4',
                               Priority='average',
                               CustomerUser='******')
     self.assertIsInstance(tic, Ticket)
     self.assertEqual(tic.__repr__(), '<Ticket>')
Exemple #2
0
 def test_create_basic_title_queue_state_prio_customer_two(self):
     tic = Ticket.create_basic(Title='foobar',
                               Queue='raw',
                               TypeID='2',
                               State='open',
                               PriorityID='5',
                               CustomerUser='******')
     self.assertIsInstance(tic, Ticket)
     self.assertEqual(tic.__repr__(), '<Ticket>')
Exemple #3
0
    def test_pending_text(self):
        tic = Ticket.create_basic(Title='foobar',
                                  QueueID='1',
                                  State='open',
                                  PriorityID='5',
                                  CustomerUser='******')

        self.assertDictEqual(
            tic.datetime_to_pending_time_text(datetime(1, 2, 3, 4, 5)), {
                'Day': 3,
                'Hour': 4,
                'Minute': 5,
                'Month': 2,
                'Year': 1
            })
Exemple #4
0
 def test_create_basic_title_queue_state_prio_customer_to_dct(self):
     tic = Ticket.create_basic(Title='foobar',
                               QueueID='1',
                               State='open',
                               PriorityID='5',
                               CustomerUser='******')
     self.assertIsInstance(tic, Ticket)
     self.assertDictEqual(
         tic.to_dct(), {
             'Ticket': {
                 'Title': 'foobar',
                 'QueueID': '1',
                 'State': 'open',
                 'PriorityID': '5',
                 'CustomerUser': '******'
             }
         })
Exemple #5
0
 def test_ticket_to_dct_no_articles_dynamic_fields(self):
     tic = Ticket.create_basic(Title='foobar',
                               QueueID='1',
                               State='open',
                               PriorityID='5',
                               CustomerUser='******')
     self.assertIsInstance(tic, Ticket)
     delattr(tic, 'articles')
     delattr(tic, 'dynamic_fields')
     self.assertDictEqual(
         tic.to_dct(), {
             'Ticket': {
                 'Title': 'foobar',
                 'QueueID': '1',
                 'State': 'open',
                 'PriorityID': '5',
                 'CustomerUser': '******'
             }
         })