def draw_square_width_height(request, width, height, color): #check if is a square (two sides equal) if not height: height = width if not color: color = utils.random_color() #Create the image width, height = int(width), int(height) s = Square(width, height, color) return draw_factory(s)
def test_random_color(self): self.assertTrue(utils.color_hex_to_dec(utils.random_color()) <\ settings.RGB_COMBS)