Skip to content

Commit

Permalink
resolved test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nyashaChiza committed Aug 18, 2024
1 parent 143a21b commit a076edc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stegnography/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def setUp(self):
self.client = Client()
# Ensure MEDIA_ROOT directory exists
os.makedirs(settings.MEDIA_ROOT, exist_ok=True)
self.encode_url = reverse('encode') # Update this if your URL pattern is different
self.encode_url = reverse('text_encode') # Update this if your URL pattern is different

def test_encode_view_post(self):
# Create a dummy image for testing
Expand All @@ -35,7 +35,7 @@ def test_encode_view_post(self):

# Check if the response is rendered correctly
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'encryption/encrypt_result.html')
self.assertTemplateUsed(response, 'encryption/text/encrypt_result.html')

# Check if the file was saved
file_name = response.context['stego_image_file_name']
Expand All @@ -48,13 +48,13 @@ def test_encode_view_post(self):
def test_encode_view_get(self):
response = self.client.get(self.encode_url)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'encryption/encode.html')
self.assertTemplateUsed(response, 'encryption/text/encode.html')

class DecodeViewTests(TestCase):

def setUp(self):
self.client = Client()
self.decode_url = reverse('decode') # Update this if your URL pattern is different
self.decode_url = reverse('text_decode') # Update this if your URL pattern is different

def test_decode_view_post(self):
# Create a dummy image for testing
Expand All @@ -77,13 +77,13 @@ def test_decode_view_post(self):

# Check if the message was decoded
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'encryption/decode.html')
self.assertTemplateUsed(response, 'encryption/text/decode.html')
self.assertEqual(response.context['decoded_message'], message)

def test_decode_view_get(self):
response = self.client.get(self.decode_url)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'encryption/decode.html')
self.assertTemplateUsed(response, 'encryption/text/decode.html')

class DownloadFileTests(TestCase):

Expand Down

0 comments on commit a076edc

Please sign in to comment.