Example #1
0
    def test_uploads_and_sounds_are_in_table(self):
        song_one = Track()
        song_one.text = "The first song"
        song_one.path = 28436940
        song_one.save()
        song_two = UploadedMusic()
        file_path = "/play/dummy.wav"
        song_two.musicfile = file_path
        song_two.save()
        song_three = Track()
        song_three.text = "Second song"
        song_three.path = 409284092
        song_three.save()
        saved_songs = Song.objects.all()

        self.assertEqual(saved_songs.count(), 3)
        self.assertNotEqual(saved_songs[0].song_id, saved_songs[1].song_id)
Example #2
0
    def test_track_models(self):
        song_first = Track()
        song_first.text = "The first song"
        song_first.path = 839204
        song_first.save()

        song_second = Track()
        song_second.text = "Second song we play"
        song_second.path = 7308284
        song_second.save()

        saved_songs = Track.objects.all()
        self.assertEqual(saved_songs.count(), 2)

        self.assertEqual(saved_songs[0].text, "The first song")
        self.assertEqual(saved_songs[1].text, "Second song we play")
        self.assertEqual(saved_songs[0].path, 839204)
        self.assertEqual(saved_songs[1].path, 7308284)