Пример #1
0
    def test_extended_types_encryption(self):
        e = {
            "a": Factory.rand_phone(),
            "b": Factory.rand_phone(),
            "c": Factory.temp_password(),
        }
        historical_event = HistoricalEvent.objects.create()
        historical_event.event_data = e
        historical_event.save()
        historical_event = None
        historical_event = HistoricalEvent.objects.all()[0]
        self.assertEquals(historical_event.event_data, e)

        e = {
            "a": Factory.rand_name(),
            "b": Factory.rand_phone(),
            "c": Factory.rand_name(),
        }
        historical_event = HistoricalEvent.objects.create()
        historical_event.event_data = e
        historical_event.save()
        historical_event = None
        historical_event = HistoricalEvent.objects.all()[0]
        self.assertEquals(historical_event.event_data, e)

        e = {
            "a": Factory.temp_password(),
            "q": Factory.rand_phone(),
            "l": settings,
        }
        historical_event = HistoricalEvent.objects.create()
        historical_event.event_data = e
        historical_event.save()
        historical_event = None
        historical_event = HistoricalEvent.objects.all()[0]
        self.assertEquals(historical_event.event_data, e)

        e = {
            "p": Factory.rand_url(),
            "r": Factory.rand_rand_phoneurl(),
            "a": Factory.temp_password(),
        }
        historical_event = HistoricalEvent.objects.create()
        historical_event.event_data = e
        historical_event.save()
        historical_event = None
        historical_event = HistoricalEvent.objects.all()[0]
        self.assertEquals(historical_event.event_data, e)
Пример #2
0
    def test_extended_types_encryption(self):
        e = Factory.rand_phone()
        historical_event = HistoricalEvent.objects.create()
        historical_event.event_data = e
        historical_event.save()
        historical_event = None
        historical_event = HistoricalEvent.objects.all()[0]
        self.assertEquals(historical_event.event_data, e)

        e = Factory.rand_name()
        historical_event = HistoricalEvent.objects.create()
        historical_event.event_data = e
        historical_event.save()
        historical_event = None
        historical_event = HistoricalEvent.objects.all()[0]
        self.assertEquals(historical_event.event_data, e)

        e = Factory.temp_password()
        historical_event = HistoricalEvent.objects.create()
        historical_event.event_data = e
        historical_event.save()
        historical_event = None
        historical_event = HistoricalEvent.objects.all()[0]
        self.assertEquals(historical_event.event_data, e)

        e = Factory.rand_url()
        historical_event = HistoricalEvent.objects.create()
        historical_event.event_data = e
        historical_event.save()
        historical_event = None
        historical_event = HistoricalEvent.objects.all()[0]
        self.assertEquals(historical_event.event_data, e)
Пример #3
0
    def test_extended_types_encryption(self):
        e = Factory.rand_phone()
        self.assertEquals(e, decrypt(encrypt(e)))

        e = Factory.rand_name()
        self.assertEquals(e, decrypt(encrypt(e)))

        e = Factory.temp_password()
        self.assertEquals(e, decrypt(encrypt(e)))

        e = Factory.rand_url()
        self.assertEquals(e, decrypt(encrypt(e)))