Ejemplo n.º 1
0
 def test_good_lookup(self):
     view = CallsignLookupView()
     view.get_qrz_data = lambda x,y: GOOD_RECORD
     ctx = view.setup_context(callsign='KC2ZUF')
     self.assertTrue(ctx['qrz'].is_authenticated)
     self.assertFalse( ctx['qrz'].error)
     self.assertEquals('KC2ZUF', ctx['qrz'].call)
Ejemplo n.º 2
0
 def test_url_failure(self):
     view = CallsignLookupView()
     view.load_url = lambda x: None
     ctx = view.setup_context(callsign='KC2ZUF')
     self.assertFalse(ctx['qrz'].is_authenticated)
     self.assertEquals('Unable to connect to QRZ.com',ctx['qrz'].error)
Ejemplo n.º 3
0
 def test_bad_session(self):
     view = CallsignLookupView()
     view.get_qrz_data = lambda x,y: BAD_SESSION
     ctx = view.setup_context(callsign='KC2ZUF')
     self.assertFalse(ctx['qrz'].is_authenticated)
     self.assertFalse(ctx['qrz'].error)
Ejemplo n.º 4
0
 def test_missing_callsign(self):
     view = CallsignLookupView()
     view.get_qrz_data = lambda x,y: None
     self.assertEquals('Missing callsign.', view.setup_context()['qrz'].error)