def test_image_folder_get_false_image_folder_if_slug_is_empty_expected_empty_string( self): instance = Order(slug='') filename = 'photo_2019-12-24_00-20-22.jpg' actual = image_folder(instance, filename) expected = '' self.assertEquals(actual, expected)
def test_image_folder_get_true_image_folder_expected_hoya_hyphen_kerry_slash_hoya_hyphen_kerry_dot_jpg( self): instance = Order(slug='hoya-kerry') filename = 'photo_2019-12-24_00-20-22.jpg' actual = image_folder(instance, filename) expected = 'hoya-kerry/hoya-kerry.jpg' self.assertEquals(actual, expected)
def test_image_folder_get_false_image_folder_if_filename_is_None_expected_empty_string( self): instance = Order(slug='hoya-kerry') filename = None actual = image_folder(instance, filename) expected = '' self.assertEquals(actual, expected)
def test_order_get_absolute_url_get_false_url_if_slug_is_None_expected_empty_string( self): order: Order = Order(slug=None) actual = order.get_absolute_url() expected = '' self.assertEquals(actual, expected)
def test_order_get_absolute_url_get_true_url_expected_slash_order_slash_pakhifitum_slash( self): order: Order = Order(slug='pakhifitum') actual = order.get_absolute_url() expected = '/order/pakhifitum/' self.assertEquals(actual, expected)
def test_order_get_absolute_url_get_true_url_expected_slash_order_slash_hoya_hyphen_kerry_slash( self): order: Order = Order(slug='hoya-kerry') actual = order.get_absolute_url() expected = '/order/hoya-kerry/' self.assertEquals(actual, expected)