Beispiel #1
0
    def testUploadChronicle(self):
        c = Client()
        self.assertTrue(c.login(username='******', password='******'))
        
        loadfn = 'chronicle_camarilla_five_xml.gex'
        for app_fixture in get_fixture_path_gen():
            if os.path.exists(os.path.join(app_fixture, loadfn)):
                with open(os.path.join(app_fixture, loadfn), 'r') as f:
                    c.post("/characters/upload_sheet/",
                           {'title': 'whocares',
                            'file': f,
                            'action': 'upload'})
        response = c.get("/characters/list_sheet/carma-adam-st-charles/")
        self.assertEqual(response.status_code, 200, "Can't access XML sheets")

        c = Client()
        self.assertTrue(c.login(username='******', password='******'))
        loadfn = 'chronicle_camarilla_five_bin.gex'
        for app_fixture in get_fixture_path_gen():
            if os.path.exists(os.path.join(app_fixture, loadfn)):
                with open(os.path.join(app_fixture, loadfn), 'rb') as f:
                    c.post("/characters/upload_sheet/",
                           {'title': 'whocares',
                            'file': f,
                            'action': 'upload'})
        response = c.get("/characters/list_sheet/kritn-adam-st-charles/")
        self.assertEqual(response.status_code, 200, "Can't access binary sheets")

        xlist = User.objects.get(username__exact='Carma').personal_characters.order_by('name')
        blist = User.objects.get(username__exact='Kritn').personal_characters.order_by('name')
        self.assertNotEqual(len(xlist), 0)
        self.assertNotEqual(len(blist), 0)
        for xv, bv in izip(xlist, blist):
            compare_vampire_sheets(self, xv.vampiresheet, bv.vampiresheet)
Beispiel #2
0
 def testEquivalenceFive(self):
     self.loadChrons('chronicle_camarilla_five_xml.gex', 'chronicle_camarilla_five_bin.gex')
     xlist = self.userx.personal_characters.order_by('name')
     blist = self.userb.personal_characters.order_by('name')
     self.assertNotEqual(len(xlist), 0)
     self.assertNotEqual(len(blist), 0)
     for xv, bv in izip(self.userx.personal_characters.order_by('name'), self.userb.personal_characters.order_by('name')):
         compare_vampire_sheets(self, xv.vampiresheet, bv.vampiresheet)
Beispiel #3
0
    def testExportEquivalence(self):
        vampire_sheet = VampireSheet.objects.get(name__exact='Charles McMillan')
        vampire_sheet.name = "Suckon Deez Nuts"
        ve = VampireExporter(vampire_sheet)
        #print ve
        sf = StringIO.StringIO(unicode(ve))
        handle_sheet_upload(sf, self.user)

        new_sheet = VampireSheet.objects.get(name__exact='Suckon Deez Nuts')

        compare_vampire_sheets(self, new_sheet, vampire_sheet)