示例#1
0
 def test_get_defaults_polaroids(self):
     template = Template("polaroids", self.public_key, self.secret_key)
     defaults = template.get_defaults()
     self.assertEquals(defaults, {
         "address_code_index": 9, "border": 17.007874,
         "bottom_grip": 28.3464567, "colors": [],
         "group_gutter": 0, "groups_x": 1,
         "groups_y": 1, "gutter_bleed": 8.50393701,
         "image_replacements": {}, "is_image_grid": True,
         "left_grip": 14.173228, "nx": 3,
         "ny": 4, "pages": [{
             "frames": [], "images": [], "name": "second", "strings": []
             }],
         "paragraph_styles": [], "polaroid_grip": 39.68503938,
         "unit_height": 252.2834645668, "unit_width": 212.598425
         })
示例#2
0
 def test_get_defaults_polaroids_mini(self):
     template = Template("polaroids_mini", self.public_key, self.secret_key)
     defaults = template.get_defaults()
     self.assertEquals(defaults, {
         "address_code_index": 20, "border": 11.9055118,
         "bottom_grip": 28.3464567, "colors": [],
         "group_gutter": 0, "groups_x": 1,
         "groups_y": 1, "gutter_bleed": 8.50393701,
         "image_replacements": {}, "is_image_grid": True,
         "left_grip": 14.173228, "nx": 4,
         "ny": 6, "pages": [{
             "frames": [], "images": [],
             "name": "second", "strings": []
             }],
         "paragraph_styles": [], "polaroid_grip": 22.67716536,
         "unit_height": 176.0314960629, "unit_width": 153.354331
         })
示例#3
0
 def test_get_defaults_squares_mini(self):
     template = Template("squares_mini", self.public_key, self.secret_key)
     defaults = template.get_defaults()
     self.assertEquals(
         defaults, {
             "address_code_index":
             20,
             "border":
             9.9216,
             "bottom_grip":
             28.3464567,
             "colors": [],
             "group_gutter":
             0,
             "groups_x":
             1,
             "groups_y":
             1,
             "gutter_bleed":
             8.50393701,
             "image_replacements": {},
             "is_image_grid":
             True,
             "left_grip":
             14.173228,
             "nx":
             4,
             "ny":
             6,
             "pages": [{
                 "frames": [],
                 "images": [],
                 "name": "second",
                 "strings": []
             }],
             "paragraph_styles": [],
             "polaroid_grip":
             0,
             "unit_height":
             172.913385827,
             "unit_width":
             172.913385827
         })
示例#4
0
 def test_get_defaults_polaroids(self):
     template = Template("polaroids", self.public_key, self.secret_key)
     defaults = template.get_defaults()
     self.assertEquals(
         defaults, {
             "address_code_index":
             9,
             "border":
             17.007874,
             "bottom_grip":
             28.3464567,
             "colors": [],
             "group_gutter":
             0,
             "groups_x":
             1,
             "groups_y":
             1,
             "gutter_bleed":
             8.50393701,
             "image_replacements": {},
             "is_image_grid":
             True,
             "left_grip":
             14.173228,
             "nx":
             3,
             "ny":
             4,
             "pages": [{
                 "frames": [],
                 "images": [],
                 "name": "second",
                 "strings": []
             }],
             "paragraph_styles": [],
             "polaroid_grip":
             39.68503938,
             "unit_height":
             252.2834645668,
             "unit_width":
             212.598425
         })
示例#5
0
 def test_get_defaults_default_postcard(self):
     template = Template("default_postcard", self.public_key,
                         self.secret_key)
     defaults = template.get_defaults()
     self.assertEquals(
         defaults, {
             "colors": [{
                 "name": "BLACK",
                 "value": "#1a1919"
             }, {
                 "name": "NAVY",
                 "value": "#000F55"
             }],
             "page_height":
             306.14173236,
             "page_width":
             429.448819005,
             "pages": [{
                 "frames": [],
                 "images": [{
                     "default_id": "1",
                     "height": 306.14173236,
                     "name": "photo",
                     "preserve_aspect_ratio": 1,
                     "width": 429.448819005,
                     "x": 0,
                     "y": 0
                 }, {
                     "default_id": "",
                     "height": 306.14173236,
                     "name": "overlay_image",
                     "preserve_aspect_ratio": 1,
                     "width": 429.448819005,
                     "x": 0,
                     "y": 0
                 }],
                 "name":
                 "first",
                 "strings": []
             }, {
                 "background_pdf_id":
                 "7",
                 "frames": [{
                     "height": 170.28,
                     "image": {
                         "align": "left",
                         "bottom_padding": 0,
                         "default_id": "2",
                         "height": 49.019,
                         "left_padding": 0,
                         "preserve_aspect_ratio": 1,
                         "right_padding": 11,
                         "top_padding": 0,
                         "width": 41.572
                     },
                     "name": "frame1",
                     "on_overflow": "truncate",
                     "width": 194.134,
                     "x": 46.531,
                     "y": 92.32
                 }, {
                     "height": 11,
                     "name": "addr1",
                     "on_overflow": "shrink",
                     "width": 102.722,
                     "x": 285.295,
                     "y": 197.365
                 }, {
                     "height": 11,
                     "name": "addr2",
                     "on_overflow": "shrink",
                     "width": 102.722,
                     "x": 285.295,
                     "y": 176.873
                 }, {
                     "height": 11,
                     "name": "addr3",
                     "on_overflow": "shrink",
                     "width": 102.722,
                     "x": 285.295,
                     "y": 156.381
                 }, {
                     "height": 11,
                     "name": "addr4",
                     "on_overflow": "shrink",
                     "width": 102.722,
                     "x": 285.295,
                     "y": 135.889
                 }, {
                     "height": 11,
                     "name": "addr5",
                     "on_overflow": "shrink",
                     "width": 102.722,
                     "x": 285.295,
                     "y": 115.397
                 }, {
                     "height": 11,
                     "name": "addr6",
                     "on_overflow": "shrink",
                     "width": 102.722,
                     "x": 285.295,
                     "y": 94.905
                 }, {
                     "height": 11,
                     "name": "addr7",
                     "on_overflow": "shrink",
                     "width": 102.722,
                     "x": 285.295,
                     "y": 74.411
                 }, {
                     "height": 28.17,
                     "name": "location",
                     "on_overflow": "shrink",
                     "width": 85.779,
                     "x": 303.021,
                     "y": 31.141
                 }],
                 "images": [{
                     "default_id": "3",
                     "height": 50,
                     "name": "ppi",
                     "width": 97.62,
                     "x": 310,
                     "y": 225
                 }, {
                     "default_id": "4",
                     "height": 18.9,
                     "name": "airmail",
                     "width": 50,
                     "x": 275,
                     "y": 225
                 }, {
                     "height": 2.272,
                     "name": "extra_dots",
                     "width": 104.277,
                     "x": 284.904,
                     "y": 70.357
                 }, {
                     "height": 17.287,
                     "name": "location_icon",
                     "preserve_aspect_ratio": 1,
                     "width": 12.193,
                     "x": 284.111,
                     "y": 42.021
                 }],
                 "name":
                 "second",
                 "strings": [{
                     "align": "center",
                     "color": "#d5d5d5",
                     "default_text": "PS300 - XXXXXXXXXXXXXXXX - J123456",
                     "font_id": "10",
                     "font_size": 5,
                     "name": "job_id",
                     "rotate": 90,
                     "x": 150.314,
                     "y": -266.458
                 }]
             }],
             "paragraph_styles": [{
                 "align": "left",
                 "font_color": "#000F55",
                 "font_id": "8",
                 "font_size": 9,
                 "leading": 20,
                 "name": "body"
             }, {
                 "align": "center",
                 "font_color": "#000F55",
                 "font_id": "8",
                 "font_size": 9,
                 "leading": 9,
                 "name": "body-centered"
             }, {
                 "align": "left",
                 "font_color": "#0000000",
                 "font_id": "9",
                 "font_size": 8.5,
                 "leading": 8.5,
                 "name": "location1",
                 "space_after": 4
             }, {
                 "align": "left",
                 "font_color": "#000000",
                 "font_id": "10",
                 "font_size": 8.5,
                 "leading": 8.5,
                 "name": "location2"
             }, {
                 "align": "center",
                 "font_color": "#000F55",
                 "font_id": "",
                 "font_size": 9,
                 "leading": 9,
                 "name": "postcode-or-country"
             }]
         })
示例#6
0
 def test_get_defaults_default_postcard(self):
     template = Template(
         "default_postcard", self.public_key, self.secret_key
         )
     defaults = template.get_defaults()
     self.assertEquals(defaults, {
         "colors": [
             {"name": "BLACK", "value": "#1a1919"},
             {"name": "NAVY", "value": "#000F55"}
             ],
         "page_height": 306.14173236, "page_width": 429.448819005,
         "pages": [
             {
                 "frames": [],
                 "images": [
                     {
                         "default_id": "1",
                         "height": 306.14173236,
                         "name": "photo",
                         "preserve_aspect_ratio": 1,
                         "width": 429.448819005,
                         "x": 0,
                         "y": 0
                         },
                     {
                         "default_id": "",
                         "height": 306.14173236,
                         "name": "overlay_image",
                         "preserve_aspect_ratio": 1,
                         "width": 429.448819005,
                         "x": 0,
                         "y": 0
                         }
                     ],
                 "name": "first",
                 "strings": []
                 },
             {
                 "background_pdf_id": "7",
                 "frames": [
                     {
                         "height": 170.28,
                         "image": {
                             "align": "left",
                             "bottom_padding": 0,
                             "default_id": "2",
                             "height": 49.019,
                             "left_padding": 0,
                             "preserve_aspect_ratio": 1,
                             "right_padding": 11,
                             "top_padding": 0,
                             "width": 41.572
                             },
                         "name": "frame1",
                         "on_overflow": "truncate",
                         "width": 194.134,
                         "x": 46.531,
                         "y": 92.32
                         },
                     {
                         "height": 11,
                         "name": "addr1",
                         "on_overflow": "shrink",
                         "width": 102.722,
                         "x": 285.295,
                         "y": 197.365
                         },
                     {
                         "height": 11,
                         "name": "addr2",
                         "on_overflow": "shrink",
                         "width": 102.722,
                         "x": 285.295,
                         "y": 176.873
                         },
                     {
                         "height": 11,
                         "name": "addr3",
                         "on_overflow": "shrink",
                         "width": 102.722,
                         "x": 285.295,
                         "y": 156.381
                         },
                     {
                         "height": 11,
                         "name": "addr4",
                         "on_overflow": "shrink",
                         "width": 102.722,
                         "x": 285.295,
                         "y": 135.889
                         },
                     {
                         "height": 11,
                         "name": "addr5",
                         "on_overflow": "shrink",
                         "width": 102.722,
                         "x": 285.295,
                         "y": 115.397
                         },
                     {
                         "height": 11,
                         "name": "addr6",
                         "on_overflow": "shrink",
                         "width": 102.722,
                         "x": 285.295,
                         "y": 94.905
                         },
                     {
                         "height": 11,
                         "name": "addr7",
                         "on_overflow": "shrink",
                         "width": 102.722,
                         "x": 285.295,
                         "y": 74.411
                         },
                     {
                         "height": 28.17,
                         "name": "location",
                         "on_overflow": "shrink",
                         "width": 85.779,
                         "x": 303.021,
                         "y": 31.141
                         }
                     ],
                 "images": [
                     {
                         "default_id": "3",
                         "height": 50,
                         "name": "ppi",
                         "width": 97.62,
                         "x": 310,
                         "y": 225
                         },
                     {
                         "default_id": "4",
                         "height": 18.9,
                         "name": "airmail",
                         "width": 50,
                         "x": 275,
                         "y": 225
                         },
                     {
                         "height": 2.272,
                         "name": "extra_dots",
                         "width": 104.277,
                         "x": 284.904,
                         "y": 70.357
                         },
                     {
                         "height": 17.287,
                         "name": "location_icon",
                         "preserve_aspect_ratio": 1,
                         "width": 12.193,
                         "x": 284.111,
                         "y": 42.021
                         }
                     ],
                 "name": "second",
                 "strings": [
                     {
                         "align": "center",
                         "color": "#d5d5d5",
                         "default_text": "PS300 - XXXXXXXXXXXXXXXX - J123456",
                         "font_id": "10",
                         "font_size": 5,
                         "name": "job_id",
                         "rotate": 90,
                         "x": 150.314,
                         "y": -266.458
                         }
                     ]
                 }
             ],
         "paragraph_styles": [
             {
                 "align": "left",
                 "font_color": "#000F55",
                 "font_id": "8",
                 "font_size": 9,
                 "leading": 20,
                 "name": "body"
                 },
             {
                 "align": "center",
                 "font_color": "#000F55",
                 "font_id": "8",
                 "font_size": 9,
                 "leading": 9,
                 "name": "body-centered"
                 },
             {
                 "align": "left",
                 "font_color": "#0000000",
                 "font_id": "9",
                 "font_size": 8.5,
                 "leading": 8.5,
                 "name": "location1",
                 "space_after": 4
                 },
             {
                 "align": "left",
                 "font_color": "#000000",
                 "font_id": "10",
                 "font_size": 8.5,
                 "leading": 8.5,
                 "name": "location2"
                 },
             {
                 "align": "center",
                 "font_color": "#000F55",
                 "font_id": "",
                 "font_size": 9,
                 "leading": 9,
                 "name": "postcode-or-country"
                 }
             ]
         })